In a web browser, navigating back from a webpage utilizes which stack operation?
Pop
Peek
Push
IsEmpty
What is the time complexity of pushing an element onto a stack implemented using a static array, assuming there is enough space?
O(1)
O(n log n)
O(n)
O(log n)
Which data structure, often used with stacks, helps manage function calls and their execution flow?
Hash Table
Queue
Heap
None of the above
In the context of the 'Next Greater Element' problem, what does the term 'next greater' refer to?
The element with the next highest value in a sorted order.
The element that is lexicographically greater.
The element that is both to the right and has a larger value.
The element that appears most frequently after the current element.
What is the space complexity of a stack that stores n integers?
O(n^2)
In the context of a dynamic array-based stack, what does amortized analysis help us determine?
The exact number of array resizes
The minimum space used by the stack
The maximum time complexity of a single push operation
The average time complexity of push operations over a sequence of operations
In which scenario would an array-based stack be a more suitable choice than a linked list-based stack?
When the maximum size of the stack is unknown.
When dealing with a very large dataset where memory usage is critical.
When frequent insertions and deletions are required in the middle of the stack.
When the stack size is known in advance and relatively small.
What is the primary advantage of using a linked list to implement a stack over an array?
Simpler implementation
Faster push and pop operations
Dynamic resizing capability
Lower memory usage
If you implement a stack using a dynamically allocated array, what is the time complexity of pushing an element in the worst-case scenario if you need to resize the array?
Which of these is NOT a typical application of stacks?
Undo/Redo functionality in text editors
Evaluating mathematical expressions (postfix notation)
Managing function calls in a program's execution
Storing data in a priority-based order