The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged stack
0
votes
1
answer
1
Stack
What is difference between $pop\left ( \right )$,$empty Stack\left ( \right )$,$delete Stack\left ( \right )$? Can all be performed in $O\left ( 1 \right )$ time?
asked
2 days
ago
in
Programming
by
srestha
Veteran
(
86.9k
points)

37
views
stack
datastructure
0
votes
2
answers
2
data structure
To remove recursion from a program we have to use which of the following data structure? array stack queue list
asked
6 days
ago
in
DS
by
eyeamgj
Active
(
2.4k
points)

53
views
datastructure
recursion
stack
0
votes
1
answer
3
Implement stack and queue using priority queue
asked
Jun 17
in
Algorithms
by
pallaviamu
(
143
points)

34
views
clrs
datastructure
stack
queues
priorityqueue
0
votes
1
answer
4
ACE Test Series Question
Suppose a stack $S$. Which is empty initially consider the following code: int values[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; for(int i=0; i<10; i++) { S.PUSH = (values[i]); } int n = 25; for (int i=0; i<4; i++) { n+= S.POP(); } for(int i=0; i<2; i++) { n= S.POP(); } printf("%d",n); The output of the program code is _________ .
asked
Jun 6
in
DS
by
Shankar Kakde
(
51
points)

76
views
datastructure
stack
programming
0
votes
1
answer
5
Evaluation of Postfix expression using stack
asked
May 6
in
DS
by
JaiKumar Guwalani
(
11
points)

124
views
datastructure
timecomplexity
spacecomplexity
infixpostfix
stack
0
votes
0
answers
6
Implementation of Stack and Queue
In implementation of queue using stack, deletion of second element from front take Ο(n) time, when insertion take Ο(1) time. Is it a true statement ? Well it can be true isn't it ? because suppose elements come we simply push them without taking care of ... to stack1. dnQueue(q) 1) If stack1 is empty then error 2) Pop an item from stack1 and return it Am i right?
asked
May 5
in
Programming
by
Na462
Active
(
3.3k
points)

96
views
datastructure
queues
stack
0
votes
0
answers
7
#Test_Series
Consider implementation of stack using queue by following algorithm. Let $x$ be an element to be pushed in the stack push(q1,x) { EQ(q1,x) while(q1 does not contain 1 element) { k=DQ(q1) EQ(q1,k) } } pop(q1) { DQ(q1) } How many enqueue and dequeue operations required to push $2$ and pop $2$ elements in the empty stack?
asked
Apr 30
in
DS
by
himgta
(
477
points)

58
views
datastructure
stack
queues
0
votes
0
answers
8
Compile Design Question From run time environment
asked
Apr 16
in
Compiler Design
by
Ronish Jariwala 1
(
87
points)

40
views
compilerdesign
effectivememoryaccess
stack
symboltable
runtimeenvironments
0
votes
1
answer
9
Stack and queue
Hi please verify me We can implement a stack using only one queue. Like first insert into queue and for popping a element from stack dequeue n1 element from queue and enque into queue and then pop last element and do the same each time......try it and verify that I am right or wrong?
asked
Apr 7
in
Programming
by
Ravi prakash pandey
Junior
(
751
points)

101
views
datastructure
queues
stack
0
votes
0
answers
10
#Push & #Pop
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how many total no. of push and pop operations are needed to perform the above operation? a) Push: 12 Pop: 13 b) Push: 15 Pop: 16 c) Push: 11 Pop: 10 d) Push: 12 Pop: 11
asked
Jan 31
in
DS
by
Tuhin Dutta
Loyal
(
7.9k
points)

105
views
datastructure
stack
queue
0
votes
0
answers
11
Made Easy Mock 1
Consider the following statements: S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front ... Ο(n) time. Both the statements are true. HOW? Kindly provide a detailed explanation. I am unable to solve such questions.
asked
Jan 31
in
DS
by
_jerry
(
353
points)

94
views
madeeasytestseries
datastructure
stack
queues
+2
votes
0
answers
12
TestSeries Stack
Given finite alphabet S = {A, B, C} and stack S of size 100. There are only three stack operations we can perform as mentioned below. Stack is initially empty and we do not perform pop ( ) on empty stack. Assume that only emit ( ) can print output and stack may or ... of stack operations to get A B C A C B A as output are ______. I am getting 15 but it is given 14. Please help.
asked
Jan 26
in
Programming
by
MiNiPanda
Loyal
(
5.8k
points)

90
views
datastructure
stack
madeeasytestseries
+1
vote
1
answer
13
ME  BASIC  4 Data Structures
Consider the following statements: S1: If stack is implemented as an array, all the operation push, pop, is_empty stack ( ), delete stack ( ) can be performed in constant time. S2: If stack is implemented as a linked list, all the ... structure. S4: Circular queues can be implemented with the help of the stack data structure. Which of the following option is false?
asked
Jan 23
in
DS
by
Rishabh Gupta 2
Boss
(
13.9k
points)

212
views
madeeasytestseries
datastructure
stack
queues
+1
vote
0
answers
14
drawback of Stack storage allocatioin
The drawback with stack storage allocation is when function complete its execution its result cannot be used some point of time later. Can you please explain this breifly ?
asked
Jan 21
in
Compiler Design
by
MIRIYALA JEEVAN KUMA
Active
(
1.8k
points)

71
views
compilerdesign
datastructure
stack
+2
votes
1
answer
15
Implementation of queue using stack
In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ? True / False
asked
Jan 20
in
Algorithms
by
Hemant Parihar
Boss
(
14.8k
points)

209
views
datastructure
queues
stack
+1
vote
0
answers
16
TestSeries Stacks
Not able to understand the question. Kindly elaborate along with an explanation. Thank you.
asked
Jan 18
in
Programming
by
MiNiPanda
Loyal
(
5.8k
points)

68
views
datastructure
stack
madeeasytestseries
+1
vote
0
answers
17
Stack
Isn't this que incomplete because no order is defined in which elements have to be pushed ..
asked
Jan 13
in
Programming
by
Pawan Kumar 2
Active
(
4.5k
points)

56
views
stack
+1
vote
2
answers
18
Implementation of stack using queues
What are the minimum enqueue and dequeue operations needed to perform pop operation for a stack which is implemented with two queues if there are already 10 elements in the first queue?
asked
Jan 12
in
DS
by
Ibtisam Sayyad
(
17
points)

172
views
datastructure
stack
queues
+2
votes
0
answers
19
Recursion Stack
My doubt is, In the stack, we will push [main()>PTN(3)>PTN(2)>PTN(1)>PTN(0)] PTN = printTwoNumbers function call Then according to answer PTN(0) won't pushed into stack, but at least to check if and return we should push it. What's the correct. My answer is 5, given is 4
asked
Jan 5
in
DS
by
Ashwin Kulkarni
Boss
(
17.7k
points)

105
views
datastructure
stack
recursion
+1
vote
0
answers
20
made easy test series
Consider the following statements: S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ?
asked
Jan 3
in
Programming
by
chandra sai
Active
(
1.2k
points)

141
views
stack
queues
datastructure
0
votes
0
answers
21
Stack
Consider a stack and we wish to perform an operation StackDelete() in which we wish to delete all the elements of the stack .What is the worst case time complexity of doing this if stack is implemented: 1) Using an array 2)Using a Linked list
asked
Dec 26, 2017
in
Programming
by
VS
Loyal
(
8.7k
points)

107
views
datastructure
stack
+1
vote
0
answers
22
Min #Stack operations
Let's consider we have a stack with three operations defined on it:: Push,Pop, Peek We have to print "ABCACBA" using the above operations. Give the min no of operations for doing it and also specify the operations in order.
asked
Dec 9, 2017
in
Programming
by
Tuhin Dutta
Loyal
(
7.9k
points)

72
views
datastructure
stack
+2
votes
0
answers
23
Stack
asked
Nov 25, 2017
in
Programming
by
Lakshman Patel RJIT
Loyal
(
7.7k
points)

60
views
datastructure
stack
0
votes
0
answers
24
Expression evaluation question
To evaluate an expression with any embedded function call at any time how many stacks are needed?
asked
Nov 19, 2017
in
Compiler Design
by
iarnav
Loyal
(
7.3k
points)

81
views
stack
expressiontree
datastructure
compiled
compilerdesign
0
votes
1
answer
25
virtual gate
asked
Nov 18, 2017
in
DS
by
Manoja Rajalakshmi A
Active
(
2.8k
points)

58
views
stack
stackinstance
0
votes
2
answers
26
Stack Expression Evaluation
How many stack do we required to evaluate an arithmetic expression? (expression like , 1 + 2 * 3  4) One stack is enough Two Stack is needed Number of stack equal to height of tree formed by the expression None of these
asked
Nov 17, 2017
in
Programming
by
hacker16
Active
(
2.7k
points)

191
views
datastructure
stack
expressiontree
+2
votes
0
answers
27
Queues using stacks
PLEASE PROVIDE SOURCE FOR THIS CONCEPT Suppose that queue operations are implemented using stack operation. enqueue(x) and Dequeue( ) are queue operations whereas Pop( ) and Push(x) are stack operations. Consider the following code Enqueue(S1,x){ Push(S1,x); } Dequeue(S1,S2){ if(!IsEmptyStack S2) ... S2)); and S1; (C) Push (S1, Pop (S2)); and S2; (D) Push (S2, Pop (S1)); and S1;
asked
Nov 13, 2017
in
DS
by
Parshu gate
Active
(
4.9k
points)

167
views
queues
stack
datastructure
+1
vote
1
answer
28
stack operations using queue
Suppose Stack operations are implemented using Queue Operation. Push(x) and Pop() are stack operations whereas enqueue(x) and dequeue are Queue operations. Consider the code: pop() { return Q.dequeue(); } push(x) { n= Q.size(); //Q.size() returns the number of ... operation correctly (A) Q.enqueue(x) (B) Q.enqueue(Q.deqeue()) (C) Q.dequeue(Q.enqueue(x)) (D) Q.dequeue()
asked
Nov 12, 2017
in
DS
by
Parshu gate
Active
(
4.9k
points)

214
views
datastructure
stack
queues
priorityqueue
0
votes
2
answers
29
Stack
Let S be a stack of size 4 ≥ 1 and it is initially empty. Suppose we push the numbers 1, 2, 3, 4 in sequence and then perform 4 pop operations. Let one push operation takes 5 ns; one pop operation takes 5 ns; the time between the end of one such stack ... to the start of the pop operation that removes p from the stack. The average stacklife of an element of this stack is ___________ (in ns).
asked
Nov 7, 2017
in
DS
by
shivangi5
Active
(
1.4k
points)

122
views
datastructure
stack
+2
votes
2
answers
30
Stack
Consider an efficient implementation of a data structure STACKMAX that support an operation max( ) that reports the current maximum among all elements in the stack. Normal stack operations i.e., push, pop are also to be supported. The size of above data structure after performing ... (8), pop, pop, max, push (5) is ________ (in bytes). Assume that an integer can be stored in 4 bytes.
asked
Nov 7, 2017
in
DS
by
shivangi5
Active
(
1.4k
points)

206
views
datastructure
stack
Page:
1
2
3
4
5
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
IISc CSA and CDCS written test and interview Experince
IIIT Hyderabad Interview Experience
My failure, Oh wait SUCCESS journey
ALGORITHMS CHECKLIST:
A Failure who got into IISc
Follow @csegate
Gatecse
Recent questions tagged stack
Recent Blog Comments
Sir I didn't get an email for GO classroom, ...
any one with marks less than 125 selected?
Thank you @Arjun Sir, @NamitaAIR1, @Priyanka, ...
Your story is very inspiring for the boys like me ...
So you completed your Btech in 5 yrs? How could ...
36,194
questions
43,647
answers
124,088
comments
42,928
users