What is the space complexity of a stack that stores n integers?
O(n^2)
O(n)
O(1)
O(log n)
What is the time complexity of pushing an element onto a stack implemented using a linked list, assuming the push operation is implemented efficiently?
O(n log n)
You are designing a system to validate arithmetic expressions. Which data structure is most suitable for checking if parentheses '(' '[' '{' are balanced in an expression?
Binary Tree
Queue
Linked List
Stack
Which data structure is most similar to a deque in terms of functionality?
Heap
Binary Search Tree
Why is it generally more efficient to check if a stack is empty before popping an element?
It doesn't make a significant difference in terms of efficiency.
To ensure the stack pointer is correctly updated.
To prevent potential errors or exceptions if the stack is empty.
To avoid unnecessary computations within the pop operation.
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?
If you implement a stack using an array, what problem might you encounter if you keep pushing elements onto the stack without any limit?
Stack Overflow
None of the above
Memory Leak
Segmentation Fault
What is the time complexity of pushing an element onto a stack implemented using a static array, assuming there is enough space?
Which data structure is most closely related to the concept of recursion?
Tree
In a web browser, navigating back from a webpage utilizes which stack operation?
Push
Pop
Peek
IsEmpty