NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
VISIT NOW

GATE CSE

Stacks and Queues

Data Structures

Previous Years Questions

Marks 1

More
Consider the queues Q1 containing four elements and Q2 containing none (shown as the Initial State in the figure). The o...
GATE CSE 2022
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of t...
GATE CSE 2016 Set 1
The result evaluating the postfix expression $$10\,\,5\, + 60$$ $$\,\,6/\, * \,8\, - $$ is
GATE CSE 2015 Set 3
A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S)...
GATE CSE 2005
The best data structure to check whether an arithmetic expression has balanced parentheses is a
GATE CSE 2004
Which of the following is essential for converting an infix expression to the postfix form efficiently?
GATE CSE 1997
Consider the following statements: (i) First-in-first out types of computations are efficiently supported by STACKS. (...
GATE CSE 1996

Marks 2

More
Consider the following sequence of operations on an empty stack. push(54); push(52); pop(); push(55); push(62); s = pop...
GATE CSE 2021 Set 1
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in ad...
GATE CSE 2014 Set 2
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insert...
GATE CSE 2012
Consider the following C program: #include #define EOF -1 void push (int); /* push the argument on the stack */ ...
GATE CSE 2007
The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 * - Note...
GATE CSE 2007
Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are: ...
GATE CSE 2007
The following function computes the value of mCn correctly for all legal values m and n (m≥1,n≥0 and m>n) int func(...
GATE CSE 2006
An implementation of a queue Q, using two stacks S1 and S2, is given below: void insert(Q, X){ push(S1, X); } void de...
GATE CSE 2006
A program attempts to generate as many permutation as possible of the string “abcd” by pushing the character a,b,c,d in ...
GATE CSE 2004
Assume that the operators +, -, ×, are left associative and ^ is right associative. The order of precedence (from highes...
GATE CSE 2004
Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequen...
GATE CSE 2003
What value would the following function return for the input x = 95? function fun (x:integer):integer; Begin ...
GATE CSE 1998
Compute the post fix equivalent of the following expression. 3 * log(x+1) - a/2
GATE CSE 1998
A priority queue Q is used to implement a stack that stores characters. PUSH (C) is implemented INSERT (Q, C, K) where K...
GATE CSE 1997
The postfix expression for the infix expression A + B * (C + D) / F + D * E is:
GATE CSE 1995
Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the in...
GATE CSE 1994
The following sequence of operations is performed on stack: PUSH (10),PUSH (20),POP,PUSH (10),PUSH (20),POP,POP,POP,PUS...
GATE CSE 1991

Joint Entrance Examination

JEE Main JEE Advanced WB JEE

Graduate Aptitude Test in Engineering

GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN

Medical

NEET

CBSE

Class 12