Which of the following operations is NOT typically associated with a Deque?
inject (insert at the front)
push (insert at the rear)
pop (remove from the rear)
peek (view the element at the front without removing)
In a linked list-based stack implementation, what does the 'isEmpty()' operation typically check?
If the stack has reached its maximum capacity
If the head pointer is pointing to NULL
If the tail pointer is pointing to NULL
If the stack contains any elements with a value of zero
In the context of expression parsing, what role does a stack play?
Storing the lexical tokens identified in the expression.
Generating machine code from the expression.
Evaluating the parsed expression directly.
Optimizing the expression for better performance.
What is the purpose of the 'top' pointer in an array-based stack implementation?
To point to the bottom element of the stack
To store the maximum size of the stack
To store the value of the top element in the stack
To track the index of the next available position for insertion
What key advantage does a Deque (Double-ended Queue) offer over a Stack?
Deque allows insertions only at one end.
Deque allows insertions and deletions at both ends.
Deque is more memory-efficient than a Stack.
Deque allows deletions only at one end.
If you represent an arithmetic expression in postfix notation using a stack, what operation would you perform when encountering an operand (a number)?
Ignore the operand.
Pop the top two elements from the stack, perform the operation, and push the result back onto the stack.
Push the operand onto the stack.
Check if the stack is empty.
In a stack implemented using a singly linked list, which end of the list typically represents the top of the stack?
Middle
It can be either the head or the tail, depending on the implementation.
Head
Tail
In maze-solving algorithms, how does the use of a stack differ between depth-first search (DFS) and breadth-first search (BFS)?
Both DFS and BFS use stacks identically; the difference lies in how they mark visited nodes.
DFS uses a stack to explore as deeply as possible before backtracking, while BFS uses a queue to explore all neighbors at a given level.
DFS uses a stack only if the maze is solvable, while BFS always uses a queue.
BFS uses a stack to prioritize unexplored paths, while DFS uses a queue to systematically explore all directions.
What is the primary difference between 'pop' and 'peek' operations on a stack?
'Pop' retrieves the top element's value, while 'peek' removes it from the stack.
'Pop' removes the top element, while 'peek' only retrieves its value without removing it.
'Pop' is used for stacks, while 'peek' is used for queues.
'Pop' and 'peek' are interchangeable terms for the same operation.
What is the result of evaluating the prefix expression '-+5*234'?
17
7
-17
-7