Which data structure is most closely related to the concept of recursion?
Tree
Linked List
Queue
Stack
Which data structure is most similar to a deque in terms of functionality?
Binary Search Tree
Heap
How does a stack help in implementing the undo functionality in text editors?
By hashing the content.
By storing a queue of actions.
By storing a stack of states.
By using a linked list of characters.
In a backtracking algorithm, what does the act of popping an element from the stack signify?
Backtracking to a previous state
Storing a potential candidate
Exploring a new path
Finding the solution
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.
Simulating a first-in, first-out (FIFO) system.
Implementing an undo/redo functionality in a text editor.
Storing a collection of songs to be played in a shuffled order.
Which of the following is a significant drawback of implementing a stack using a static array?
Slow push and pop operations
Fixed size limitation
High memory usage
Complex implementation
In the context of memory allocation within a program, what type of stack is used?
Call Stack
What real-world scenario accurately reflects the functioning of a stack?
People standing in a queue at a ticket counter
Books arranged alphabetically on a shelf
Cars parked in a single-lane driveway
Customers waiting on hold for customer service
In which scenario would an array-based stack be a more suitable choice than a linked list-based stack?
When dealing with a very large dataset where memory usage is critical.
When the stack size is known in advance and relatively small.
When the maximum size of the stack is unknown.
When frequent insertions and deletions are required in the middle of the stack.
Which of these is NOT a typical application of stacks?
Evaluating mathematical expressions (postfix notation)
Storing data in a priority-based order
Undo/Redo functionality in text editors
Managing function calls in a program's execution