Stacks and Queues - Advanced Concepts

Download Q&A
Q. In a double-ended queue (deque), which operations can be performed at both ends?
  • A. Enqueue only
  • B. Dequeue only
  • C. Enqueue and Dequeue
  • D. None
Q. In a stack, what will be the result of popping an element from an empty stack?
  • A. Return null
  • B. Throw an exception
  • C. Return 0
  • D. Return -1
Q. What is the main disadvantage of using a stack for function call management?
  • A. Limited size
  • B. Slow access
  • C. Complex implementation
  • D. No recursion support
Q. What is the primary advantage of using a circular queue over a linear queue?
  • A. Less memory usage
  • B. Faster access time
  • C. No wasted space
  • D. Easier implementation
Q. What is the 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 pushing an element onto a stack implemented using a linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. Which data structure is best suited for implementing a function that reverses a string?
  • A. Queue
  • B. Stack
  • C. Linked List
  • D. Array
Q. Which of the following is a characteristic of a stack data structure?
  • A. FIFO
  • B. LIFO
  • C. Sorted order
  • D. Dynamic size
Q. Which of the following operations is not supported by a standard stack?
  • A. Push
  • B. Pop
  • C. Peek
  • D. Dequeue
Showing 1 to 9 of 9 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely