Question: 29. A queue is implemented using an array such that enqueue and dequeue operations are performed eff Which one of the following statements is correct

 29. A queue is implemented using an array such that enqueue

29. A queue is implemented using an array such that enqueue and dequeue operations are performed eff Which one of the following statements is correct (n refers to the number of items in the queue)? a. At most one operation can be performed in 0(1) time but the worst case time for the other operati be 2(n) b. Both operations can be performed in O(1) time c. The worst case time complexity for both operations will be 2(n) d. Worst case time complexity for both operations will be 2log n) 30. If the sequence of operations push), push(2), pop, push(), push(2), pop, pop, pop, push(2), p performed on a stack, the sequence of popped out values are? b. 2, 2, 1, 2,2 c. 2, 1, 2, 2, 1 d. 2, 1, 2, 2,2 31. The average runtime complexity of the insertion sort algorithm is: a. O(n) b. O(log2n) c. 0(n2) d. O(n log2n) 32. Which of the following data structures is a linear data structure? a. Trees b. Arrays c. Graphs d. None of the above. 33. In an array implementation of a binary heap, what is the formula to calculate the index of the pare element with index i? a. i + 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!