Stacks In Data Structures - Study Mode
[#151] An error is reported when the stack is not empty at the end.
Correct Answer
(A) True
[#152] How many stacks are required for reversing a word algorithm?
Correct Answer
(A) one
[#153] 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.
Correct Answer
(A) 6
[#154] What will be output if the following sequence of operations are executed? Push(a,s)
Push(b,s)
Pop(b)
Push(c,s)
Correct Answer
(B) b
[#155] In the given C snippet, find the statement number that has error. //C code to push an element into a stack
void push( struct stack *s, int x)
{
if(s->top==MAX-1)
{
printf(“stack overflow”)
}
else
{
s->items[++s->top]=x
s++
}
}
Correct Answer
(C) 10