Stack
Stack
Stack is a linear data structure, which is used to arrange elements in a list (array
list or link list) , using LIFO ( Last In First Out ) order.
a) Stack
b) Queue
c) Array
d) Tree
The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
a) 600
b) 350
c) 650
d) 588
Consider the following operation performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the no of element present on stack are
a) 1
b) 2
c) 3
d) 4
What is the minimum number of stacks of size n required to
implement a queue of size n?
a) One
b) Two
c) Three
d) Four
What is the maximum number of parentheses that will appear on stack at
any instance of time during the analysis of ( ( ) ( ( ) ) ( ( ) ) )?
a) 1
b) 2
c) 3
d) 4
When the user tries to delete the element from the empty stack then the
condition is said to be a ____
a) Underflow
b) Garbage collection
c) Overflow
d) None of the above
Which one of the following is not the application of the stack data
structure
a) String reversal
b) Recursion
c) backtracking
d) Asynchronous data transfer
Which one of the following node is considered the top of the stack if the
stack is implemented using the linked list?
a) First node
b) Second node
c) Last node
d) None of the above
Which of the following is true about linked list implementation of stack?
a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop
operation, nodes must be removed from end.
b) In push operation, if new nodes are inserted at the end, then in pop operation, nodes
must be removed from the beginning.
c) Both of the above
d) None of the above
What is the time complexity of the program to reverse stack when
linked list is used for its implementation?
a) O(n)
b) O(n log n)
c) O(n2)
d) O(log n)
What is the other name for a postfix expression?
a) right to left
b) left to right
c) centre to left
d) centre to right
The time complexity of converting a prefix notation to infix notation is
_________
a) S [ Top-n ]
b) S[ Top+n ]
c) S[ Top-n+1 ]
d) None of the above
When a lady wears and removes her bangles what type of data structure
she is using.
a) stack
b) queue
c) priority queue
d) hashing
Which of the following approach Recursive algorithms are worked on?
a) Bottom-up approach
b) Top-down approach
c) Hierarchical approach
d) All of the above
what is the time complexity to sort elements of a stack
a) O(1)
b) O(n)
c) O(n^2)
d) None
What type of data structure is used to create an internal space for
parameters and local variables.
a) stack
b) queue
c) array
d) tree