An error is reported when the stack is not empty at the end.
1.True
2.False
An error is thrown if the character ‘ ’ is pushed in to the character stack.
1.true
2.false
Consider the stack | 5 | | 4 | | 3 | | 2 |. At this point, ‘*’ is encountered. What has to be done?
1.5*4=20 is pushed into the stack
2.* is pushed into the stack
3.2*3=6 is pushed into the stack
4.* is ignored
Entries in a stack are “ordered”. What is the meaning of this statement?
1.A collection of stacks is sortable
2.Stack entries may be compared with the ‘<‘ operation
3.The entries are stored in a linked list
4.There is a Sequential entry that is one by one
Evaluate the following and choose the correct answer. a/b+c*d where a=4, b=2, c=2, d=1.
1.1
2.4
3.5
4.2
Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2.
1.6
2.8
3.9
4.7
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 1+2*3-2
1.3
2.6
3.5
4.4
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 4*2+3-5/5
1.10
2.11
3.16
4.12
Evaluate the postfix expression ab + cd/- where a=5, b=4, c=9, d=3.
1.23
2.15
3.6
4.10
Evaluation of infix expression is done based on precedence of operators.
1.True
2. False
How many passes does the balancing symbols algorithm makes through the input?
1.one
2.two
3.three
4.four
How many passes does the evaluation of infix expression algorithm makes through the input?
1.One
2.Two
3.Three
4. Four
How many stacks are required for applying evaluation of infix expression algorithm?
1.one
2.two
3.three
4.four
How many stacks are required for evaluation of prefix expression?
1.one
2.two
3.three
4.four
How many types of input characters are accepted by this algorithm?
1.one
2.two
3.three
4.four
Identify the infix expression from the list of options given below.
1.a/b+(c-d)
2.abc*+d+ab+cd+*ce-f-
3.ab-c-
4.+ab
If -*+abcd = 11, find a, b, c, d using evaluation of prefix algorithm.
1.a=2, b=3, c=5, d=4
2. a=1, b=2, c=5, d=4
3.a=5, b=4, c=7,d=5
4.a=1, b=2, c=3, d=4
If the corresponding end bracket/braces/parentheses is encountered, which of the following is done?
1.push it on to the stack
2.pop the stack
3.throw an error
4.treated as an exception
In a stack, if a user tries to remove an element from an empty stack it is called _________
1.Underflow
2.Empty collection
3.Overflow
4.Garbage Collection
In balancing parentheses algorithm, the string is read from?
1.right to left
2.left to right
3.center to right
4.center to left
In Postfix expressions, the operators come after the operands.
1.True
2.False
Is the given statement ((A+B) + [C-D]] valid with respect to balancing of symbols?
1.True
2.False
Of the following choices, which operator has the lowest precedence?
1.^
2.+
3./
4.#
Operations required for reversing a word or a string using stack are push() and pop().
1.True
2.False
Out of the following operators (^, *, +, &, $), the one having highest priority is _________
1.+
2.$
3. ^
4.&
Out of the following operators (|, *, +, &, $), the one having lowest priority is ________
1.+
2.$
3.|
4.&
Pushing an element into stack already having five elements and stack size of 5, then stack becomes ___________
1.Overflow
2.Crash
3.Underflow
4.User flow
Reverse Polish Notation is the reverse of a Polish Notation.
1.True
2.False
Reversing a word using stack can be used to find if the given word is a palindrome or not.
1.True
2.False
The associativity of an exponentiation operator ^ is right side.
1.True
2.False
The system throws an error if parentheses are encountered in an infix expression evaluation algorithm.
1.True
2.False
Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2)
1.12
2.8
3.10
4.6
Using the evaluation of prefix algorithm, evaluate +-9 2 7.
1.10
2.4
3.17
4.14
What data structure is used when converting an infix notation to prefix notation?
1.Stack
2.Queue
3.B-Trees
4.Linked-list
What determines the order of evaluation of a prefix expression?
1.precedence and associativity
2.precedence only
3.associativity only
4.depends on the parser
What is the other name for a postfix expression?
1.Normal polish Notation
2.Reverse polish Notation
3.Warsaw notation
4.Infix notation
What is the result of the following postfix expression? ab*cd*+ where a=2,b=2,c=3,d=4.
1.16
2.12
3.14
4.10
What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.
1.4
2.5
3.6
4.7
What is the time complexity for converting decimal to binary numbers?
1.O(1)
2.O(n)
3.O(logn)
4.O(nlogn)
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
When an operand is read, which of the following is done?
1.It is placed on to the output
2.It is placed in operator stack
3.It is ignored
4.Operator stack is emptied
When the corresponding end bracket/braces/parentheses is not found, what happens?
1.The stack is popped
2.Ignore the parentheses
3.An error is reported
4.It is treated as an exception
Which application of stack is used to ensure that the pair of parentheses is properly nested?
1.Balancing symbols
2.Reversing a stack
3.Conversion of an infix to postfix expression
4.Conversion of an infix to prefix expression
Which of the following is an example for a postfix expression?
1.a*b(c+d)
2.abc*+de-+
3.+ab
4.a+b-c
Which of the following is not an application of stack?
1.evaluation of postfix expression
2.conversion of infix to postfix expression
3.balancing symbols
4.line at ticket counter
Which of the following statement is incorrect with respect to balancing symbols algorithm?
1.{[()]}
2.([ )]
3.{( )}
4.{ [ ] }
Which of the following statement is incorrect with respect to evaluation of infix expression algorithm?
1.Operand is pushed on to the stack
2.If the precedence of operator is higher, pop two operands and evaluate
3.If the precedence of operator is lower, pop two operands and evaluate
4.The result is pushed on to the operand stack
Which of these operators have the highest order of precedence?
1.‘(‘ and ‘)’
2.‘*’ and ‘/’
3. ‘~’ and ‘^’
4.‘+’ and ‘-‘
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
While evaluating a prefix expression, the string is read from?
1.left to right
2.right to left
3.center to right
4.center to left to right