Stacks on Data Structure and Algorithms related Questions and Answers - Page 4

Question 31 : Which is the most appropriate data structure for applying balancing of symbols algorithm?
1. stack
2. queue
3. tree
4. graph
View Answer   Discuss with Members

Question 32 : What should be done when an opening parentheses is read in a balancing symbols algorithm?
1. push it on to the stack
2. throw an error
3. ignore the parentheses
4. pop the stack
View Answer   Discuss with Members

Question 33 : What will be output if the following sequence of operations are executed?
Push(a,s);
Push(b,s);
Pop(b);
Push(c,s);
1. abc
2. b
3. ac
4. acb
View Answer   Discuss with Members

Question 34 : While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?
1. push it directly on to the stack
2. pop 2 operands, evaluate them and push the result on to the stack
3. pop the entire stack
4. ignore the operator
View Answer   Discuss with Members

Question 36 : Is the given statement ((A+B) + [C-D]] valid with respect to balancing of symbols?
1. True
2. False
3.
4.
View Answer   Discuss with Members

Question 37 : Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right associative. Then, equivalent infix expression is
1. 4 a 5 6 b 7 8 a c
2. 4 a 5 c 6 b 7 a 8
3. 4 b 5 a 6 c 7 a 8
4. 4 a 5 b 6 c 7 a 8
View Answer   Discuss with Members

Question 39 : Which of the following is an infix expression?
1. (a+
2. *(c+d)b) ab+c*
3. +ab
4. abc+*
View Answer   Discuss with Members

Question 40 : What is the time complexity of the above code?
1. O(logn)
2. O(n)
3. O(1)
4. O(nlogn)
View Answer   Discuss with Members


View 31 - 40 of 77 Questions

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter