McqMate

Q. |
## What should be done when a left parenthesis ‘(‘ is encountered? |

A. | It is ignored |

B. | It is placed in the output |

C. | It is placed in the operator stack |

D. | The contents of the operator stack is emptied |

Answer» C. It is placed in the operator stack |

1.3k

0

Do you find this helpful?

4

View all MCQs in

Data Structures (DS)No comments yet

- 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?
- A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……
- 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?
- If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?
- A binary tree in which all its levels except the last, have maximum numbers of nodes, and all the nodes in the last level have only one child it will be its left child. Name the tree.
- The number of comparisons done by sequential search is ………………
- When an operand is read, which of the following is done?
- A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?
- The topological sorting of any DAG can be done in time.