Stacks and Queues - Complexity Analysis - Higher Difficulty Problems

Download Q&A
Q. If a stack is implemented using an array, what is the time complexity of resizing the array when it is full?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a circular queue implemented using an array, what is the time complexity of the enqueue operation?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what is the time complexity of the pop operation when implemented using a dynamic array?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the average time complexity of accessing an element in a queue implemented using a linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the time complexity of searching for an element in a queue implemented using an array?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. When using a stack to reverse a string, what is the time complexity of the entire operation?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Showing 1 to 6 of 6 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely