Stacks and Queues - Complexity Analysis - Numerical Applications

Download Q&A
Q. If a queue is implemented using two stacks, what is the time complexity of dequeue operation in the worst case?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a priority queue implemented with a binary heap, what is the time complexity of inserting an element?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. What is the average time complexity of accessing an element in a queue?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Showing 1 to 3 of 3 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely