McqMate

Q. |
## Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation? |

A. | 1 |

B. | 2 |

C. | none |

D. | none |

Answer» B. 2 |

935

0

Do you find this helpful?

3

View all MCQs in

Data Structures (DS)No comments yet

- Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.
- Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?
- Pushing an element into stack already having five elements and stack size of 5, then stack becomes
- When a stack is organized as an array, a variable named Top is used to point to the top element of the stack. Initially, the value of Top is set to_______to indicate an empty stack.
- A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a valid post-order sequence of the tree provided the pre-order sequence as 35, 13, 7, 8, 26, 70, 40 and 75?
- Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is
- The data structure required to check whether an expression contains balanced parenthesis is?
- The data structure required to check whether an expression contains balanced parenthesis is?
- If the elements A, B, C and D are placed in a stack and are deleted one at a time, what is the order of removal?
- In a stack, if a user tries to remove an element from empty stack it is called