Menu

Stacks Questions

MCQ
151.
Given below is the Node class to perform basic list operations and a Stack class with a no arg constructor. Select from the options the appropriate push() operation that can be included in the Stack class. Also
forum Discussion
MCQ
152.
Consider these functions:
push() : push an element into the stack

pop() : pop the top-of-the-stack element

top() : returns the item stored in top-of-the-stack-node

What will be the output after performing these sequence of operations

push(20);

push(4);

top();

pop();

pop();

pop();

push(5);

top();
forum Discussion
MCQ
153.
Which of the following data structures can be used for parentheses matching?
forum Discussion
MCQ
154.
Minimum number of queues to implement stack is ___________
forum Discussion
MCQ
155.
To implement a stack using queue(with only enqueue and dequeue operations), how many queues will you need?
forum Discussion
MCQ
156.
Making the push operation costly, select the code snippet which implements the same.(let q1 and q2 be two queues)
forum Discussion
MCQ
157.
Select the code snippet which returns the top of the stack.
forum Discussion
MCQ
158.
Select the code snippet which return true if the stack is empty, false otherwise.
forum Discussion
MCQ
159.
Which is the predefined method available in Java to convert decimal to binary numbers?
forum Discussion
MCQ
160.
What is the time complexity for converting decimal to binary numbers?
forum Discussion