Stack: GATE CS Previous Year Questions

Stack · Data Structures

13 questions · asked in 8 of 27 years (2000–2026)

MCQ 10 · MSQ 2 · NAT 11-mark 11 · 2-mark 2

2000Questions per year2026

Questions 11–13 of 13

Q11GATE 20041 markMCQ−0.33 if wrong
A single array A[1...MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top 2 (top1 <\lt top 2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for "stack full" is

Q12GATE 20031 markMCQ−0.33 if wrong
Let S be a stack of size n ≥\geq 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 operation take X seconds each , and Y seconds elapse between the end of the one such stack operation and the start of the next operation. For m ≥\geq 1, define the stack-life of m as the time elapsed from the end or Push (m) to the start of the pop operation that removes m from S . The average stack-life of an element of this stack is

Q13GATE 20021 markMCQ−0.33 if wrong
To evaluate an expression without any embedded function calls

Keep practising

Topics in Data Structures

All CS topics ›