Question 31
What is the value of the Postfix expression '8 2 / 3 * 4 +'?
$8/2 = 4; 4*3 = 12; 12+4 = 16.$
What is the value of the Postfix expression '8 2 / 3 * 4 +'?
$8/2 = 4; 4*3 = 12; 12+4 = 16.$
Which of the following statements about checking balanced parentheses with a stack are correct?
Each character is processed once. In the worst case many opening parentheses are stored, so the time is O(N) and auxiliary space is O(N). All three statements are correct.
How many moves are required to solve the standard Tower of Hanoi puzzle for N disks?
The exact number of moves is $2^N - 1$. Since that value is not among A-C, the correct choice is E: None of the above.
How many total moves are required to solve the Tower of Hanoi puzzle for N disks?
The recurrence relation for Tower of Hanoi is T(N) = 2T(N-1) + 1 with T(1)=1, which solves to $2^N - 1$.
Which queue type allows insertion at the rear end and deletion from both front and rear ends?
An Input-Restricted Deque restricts insertion to one end (rear) while allowing deletion from both ends (front and rear).