Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

stack

GATE CSE & IT · Data Structures · 1991-2026

16
PYQs
81%
keyed
1
elite explanations
14
years appeared

Study anchor

Cormen et al. — Introduction to Algorithms (CLRS)

Algorithms, data structures, graph algorithms, complexity

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

Consider a stack $S$ and a queue $Q$. Both of them are initially empty and have the capacity to store ten elements each. The elements $1,2,3,4$, and 5 arrive one by one, in that or...

easyanswer keyelite explanation
2025 Q45

Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct. We wi...

mediumanswer key
2023 PYQ

Consider a sequence a of elements $$a_0=1,a_1=5,a_2=7,a_3=8,a_4=9$$, and $$a_5=2$$. The following operations are performed on a stack S and a queue Q, both of which are initially e...

easybasic explanation
2021 PYQ

Consider the following sequence of operations on an empty stack. push(54); push(52); pop(); push(55); push(62); s = pop(); Consider the following sequence of operations on an empty...

easybasic explanation
2015 PYQ

Consider the C program below. #include < stdio.h > int *A, stkTop; int stkFunc(int opcode, int val) { static int size=0, stkTop=0; switch (opcode) { case -1: size = val; break; cas...

medium
2014 PYQ

Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the fo...

mediumanswer key
2007 PYQ

Consider the following C program: #include #define EOF -1 void push (int); /* push the argument on the stack */ int pop (void); /* pop the top of the stack */ void flagError (); in...

mediumanswer key
2005 PYQ

A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i. If a stack S contai...

easyanswer key
2004 PYQ

A program attempts to generate as many permutation as possible of the string “abcd” by pushing the character a,b,c,d in the same order onto a stack, but it may pop off the top char...

easyanswer key
2003 PYQ

Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Push and Pop...

mediumanswer key
1997 PYQ

Which of the following is essential for converting an infix expression to the postfix form efficiently?

easyanswer key
1997 PYQ

A priority queue Q is used to implement a stack that stores characters. PUSH (C) is implemented INSERT (Q, C, K) where K is an appropriate integer key chosen by the implementation....

easyanswer key
1997 PYQ

Heap allocation is required for languages.

easyanswer keybasic explanation
1996 PYQ

Consider the following statements: (i) First-in-first out types of computations are efficiently supported by STACKS. (ii) Implementing LISTS on linked lists is more efficient than...

easyanswer key
1994 PYQ

Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is the sequence 1, 2, 3, 4, 5 in that order?

mediumanswer key
1991 PYQ

The following sequence of operations is performed on stack: PUSH (10),PUSH (20),POP,PUSH (10),PUSH (20),POP,POP,POP,PUSH (20),POP The sequence of the value popped out is:

easyanswer key