GATE 2013 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2013

80 questions

MCQ 801-mark 38 · 2-mark 42

Questions 26–30 of 80

Q26Queue2 marksMCQ−0.67 if wrong
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.
 MultiDequeue(Q){
m = k
while (Q is not empty) and (m > 0) {
   Dequeue(Q)
   m = m - 1
   }
} 
What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?

Q27Binary Search Tree2 marksMCQ−0.67 if wrong
The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?

Q28Binary Search Tree1 markMCQ−0.33 if wrong
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?

Q29Sorting2 marksMCQ−0.67 if wrong
The number of elements that can be sorted in Θ(logn)\Theta (log n) time using heap sort is

Q30Sorting1 markMCQ−0.33 if wrong
Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?