What is the space complexity of a stack that stores n integers?
O(n^2)
O(n)
O(1)
O(log n)
Which data structure would be most suitable for implementing a Last-In-First-Out (LIFO) access pattern?
Stack
Queue
Deque
Heap
Which data structure is most similar to a deque in terms of functionality?
Binary Search Tree
What is the time complexity of pushing an element onto a stack implemented using a static array, assuming there is enough space?
O(n log n)
How does a stack help in converting infix expressions to postfix?
By eliminating the need for parentheses
By directly translating the expression
By prioritizing operators based on precedence
By reversing the order of operands
In a web browser, navigating back from a webpage utilizes which stack operation?
IsEmpty
Peek
Push
Pop
In which scenario would you prefer using a stack over a queue data structure?
Managing a print queue where tasks are processed in the order they arrive.
Storing a collection of songs to be played in a shuffled order.
Simulating a first-in, first-out (FIFO) system.
Implementing an undo/redo functionality in a text editor.
How do stacks and heaps differ in terms of element ordering?
Stack follows FIFO order, while heap has no specific order
Stack has no specific order, while heap maintains elements in sorted order
Both stack and heap maintain elements in sorted order, but with different sorting algorithms
Stack follows LIFO order, while heap maintains a partial ordering
Which data structure, often used with stacks, helps manage function calls and their execution flow?
None of the above
Hash Table
Which of these is NOT a typical application of stacks?
Undo/Redo functionality in text editors
Evaluating mathematical expressions (postfix notation)
Storing data in a priority-based order
Managing function calls in a program's execution