Balanced Parenthesis Multiple choice Questions and Answers (MCQs)

 

 Buy/Download all MCQ Ebook   >>>Click Here<<<

Balanced Parenthesis Multiple choice Questions and Answers (MCQs)

Click on any option to know the CORRECT ANSWERS

Question 1
What is the time complexity of balancing parentheses algorithm?
A
O (N)
B
O (N log N)
C
O (M log N)
D
O (N2)
Journalism Questions answers

Question 1 Explanation: 
The time complexity of balancing parentheses algorithm is mathematically found to be O (N).

Question 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
Computer science Questions answers

Question 2 Explanation: 
Balancing symbols application ensures that the pair of parentheses are properly nested while reversing stack reverses a stack.

Question 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
English literature Questions answers

Question 3 Explanation: 
Any string is read by the compiler from left to right and not from right to left.

Question 4
Which is the most appropriate data structure for applying balancing of symbols algorithm?
A
stack
B
queue
C
tree
D
graph
English grammar Questions answers

Question 4 Explanation: 
Stack is the most appropriate data structure for balancing symbols algorithm because stack follows LIFO principle (Last In First Out).

Question 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
Library science Questions answers

Question 5 Explanation: 
The balancing symbols algorithm using stack only includes balancing parentheses, brackets and braces and not any other symbols.

There are 5 questions to complete.

 

 Buy/Download all MCQ Ebook >>>CLICK HERE<<<