Question 21
Which statements correctly describe stack underflow during a pop operation?
A, B, and C all correctly describe stack underflow for the stated conventional array implementation.
Which statements correctly describe stack underflow during a pop operation?
A, B, and C all correctly describe stack underflow for the stated conventional array implementation.
Convert the infix expression 'A + B * C' to its equivalent postfix (RPN) notation.
Multiplication '*' has higher precedence than addition '+'. Evaluating B * C first yields 'B C *'. Then adding A yields 'A B C * +'.
Evaluate the postfix expression: '6 3 2 + * 5 -'
3 + 2 = 5. Stack: 6, 5. Step 2: 6 * 5 = 30. Stack: 30. Step 3: 30 - 5 = 25. Final result is 25.
For a circular queue of capacity N using the conventional full condition (rear + 1) mod $N = front$, which listed condition is the full condition?
Under the stated conventional representation, the full condition is (rear + 1) mod $N = front$. None of A, B, or C states that condition.
Which data structure allows insertion and deletion of elements from both ends?
A Deque (Double-Ended Queue) allows elements to be added or removed from both the front and rear ends in O(1) time.