- Computer Science Engineering (CSE)
- Data Structures (DS)
- Linear Data Structures -Stacks and Queue...
- Consider the usual algorithm for determi...

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 |

View all MCQs in:
Data Structures (DS)

- Pushing an element into stack already having five elements and stack size of 5, then stack becomes
- 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
- The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is
- The time factor when determining the efficiency of algorithm is measured by____________.
- The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of following is post-order traversal of the tree?

Login to Continue

It will take less than 2 minutes

Report MCQ