# 100+ Balanced Parenthesis Question and Answer with FREE PDF

Created by livemcqs team of experts in their respective subject, Balanced Parenthesis Question and Answer provide you with verified, comprehensive questions and answers that cover each topic in detail. They contain all the information that you need to pass both online and offline. These Balanced Parenthesis Question and Answer will help you prepare for any exam including BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

## Balanced Parenthesis Question and Answer

a) O (N)

b) O (N log N)

c) O (M log N)

d) O (N2)

##### 2. Which application of stack is used to ensure that the pair of parentheses is properly nested?

a) Balancing symbols

b) Reversing a stack

c) Conversion of an infix to postfix expression

d) Conversion of an infix to prefix expression

##### 3. In balancing parentheses algorithm, the string is read from?

a) right to left

b) left to right

c) center to right

d) center to left

a) stack

b) queue

c) tree

d) graph

##### 5. Which of the following does the balancing symbols algorithm include?

a) balancing double quotes

b) balancing single quotes

c) balancing operators and brackets

d) balancing parentheses, brackets and braces

Answer: balancing parentheses, brackets and braces

a) {[()]}

b) ([ )]

c) {( )}

d) { [ ] }

##### 7. What should be done when an opening parentheses is read in a balancing symbols algorithm?

a) push it on to the stack

b) throw an error

c) ignore the parentheses

d) pop the stack

Answer: push it on to the stack

##### 8. When the corresponding end bracket/braces/parentheses is not found, what happens?

a) The stack is popped

b) Ignore the parentheses

c) An error is reported

d) It is treated as an exception

##### 9. If the corresponding end bracket/braces/parentheses is encountered, which of the following is done?

a) push it on to the stack

b) pop the stack

c) throw an error

d) treated as an exception

a) one

b) two

c) three

d) four