Awesome q2a theme
Ask us anything
Toggle navigation
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Blogs
Previous Year
Exams
Recent questions tagged stack
0
votes
0
answers
Made Easy Test Series
Why Stack S will contain only e?and what does it mean by S=tmp here?
asked
Oct 17
in
Programming
by
Sinchit
(
15
points)

28
views
stack
0
votes
0
answers
made easy test series :Stacks
S will remain same S will contain only e' S will contain e' followed by previous element of stack in same order S will contain e' followed by previous element of stack in reverse order at 2nd last line S contains only e' then S is ... none of options match the above logic BTW answer given by them is 2 is the question/options incorrect or my reasoning is wrong???
asked
Jul 4
in
DS
by
abcd9982
(
87
points)

9
views
madeeasytestseries
stack
stackpointer
+1
vote
0
answers
Ace_Datastructures
Choose incorrect statements from the options given below ? a stack and a queue can be implemented in a single array v[1...m]. ‘n’ circular queues can be implemented in a single array v[1...m], (m>>n) n1 stacks and n2=nn1 queues can be implemented in an array v[1….m] (m >>n) None of the above Anyone please clarify.
asked
Jun 8
in
Programming
by
Shivateja MST
(
39
points)

15
views
datastructures
stack
queue
0
votes
0
answers
GATE200649 Video Solution
An implementation of a queue $Q$, using two stacks $S1$ and $S2$, is given below: void insert (Q, x) { push (S1, x); } void delete (Q) { if (stackempty(S2)) then if (stackempty(S1)) then { print( Q is empty ); return; } else while (!(stackempty(S1))){ x=pop( ... and $2m\leq y\leq 2n $ $ 2m\leq x<2n $ and $2m\leq y\leq n+m $ $ 2m\leq x<2n $ and $2m\leq y\leq 2n $
asked
Apr 18
in
DS
by
admin
(
193
points)

9
views
gate2006
datastructures
queue
stack
normal
videosolution
0
votes
0
answers
GATE200364 Video Solution
Let S be a stack of size $n \geq1$. 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 operations take $X$ seconds each, and $Y$ seconds elapse between the end of one such stack ... S. The average stacklife of an element of this stack is $n(X+Y)$ $3Y+2X$ $n(X+Y)X$ $Y+2X$
asked
Apr 18
in
DS
by
admin
(
193
points)

3
views
gate2003
datastructures
stack
normal
videosolution
0
votes
0
answers
GATE2014241 Video Solution
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 following statements is TRUE (with respect to this modified ... takes a single instruction. A queue can be implemented where both $ENQUEUE$ and $DEQUEUE$ take a single instruction each.
asked
Apr 18
in
DS
by
admin
(
193
points)

5
views
gate20142
datastructures
stack
easy
videosolution
0
votes
0
answers
GATE20012.16 Video Solution
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$? One Two Three Four
asked
Apr 18
in
DS
by
admin
(
193
points)

5
views
gate2001
datastructures
easy
stack
queue
videosolution
0
votes
0
answers
GATE19941.14 Video Solution
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 $\text{1, 2, 3, 4, 5}$ in that order? $\text{3, 4, 5, 1, 2}$ $\text{3, 4, 5, 2, 1}$ $\text{1, 5, 2, 3, 4}$ $\text{5, 4, 3, 1, 2}$
asked
Apr 18
in
DS
by
admin
(
193
points)

9
views
gate1994
datastructures
stack
normal
videosolution
0
votes
0
answers
GATE20043 Video Solution
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 $top2$ $(top < top 2)$ point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, ... $top1 + top2 = MAXSIZE$ $(top1 = MAXSIZE / 2)$ or $(top2 = MAXSIZE)$ $top1 = top2  1$
asked
Apr 18
in
DS
by
admin
(
193
points)

7
views
gate2004
datastructures
stack
easy
videosolution
0
votes
0
answers
GATE19974.7 Video Solution
A priority queue $Q$ is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT $(Q, C, K)$ where $K$ is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN ... For a sequence of operations, the keys chosen are in nonincreasing order nondecreasing order strictly increasing order strictly decreasing order
asked
Apr 18
in
DS
by
admin
(
193
points)

8
views
gate1997
datastructures
stack
normal
priorityqueue
videosolution
0
votes
0
answers
GATE2005IT13 Video Solution
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$ contains the integers $2, 3, 2, 1, 2$ in order from bottom to top, what is $f(S)$? $6$ $4$ $3$ $2$
asked
Apr 18
in
DS
by
admin
(
193
points)

6
views
gate2005it
datastructures
stack
normal
videosolution
0
votes
0
answers
GATE200738, ISRO201627 Video Solution
The following postfix expression with single digit operands is evaluated using a stack: $8 \ 2 \ 3 \ {}^\hat{\mkern6mu} / \ 2 \ 3 * + 5 \ 1 * $ Note that $^\hat{}$ is the exponentiation operator. The top two elements of the stack after the first $*$ is evaluated are $6, 1$ $5, 7$ $3, 2$ $1, 5$
asked
Apr 18
in
DS
by
admin
(
193
points)

3
views
gate2007
datastructures
stack
normal
isro2016
videosolution
0
votes
0
answers
GATE19952.21 Video Solution
The postfix expression for the infix expression $A+B*(C+D)/F+D*E$ is: $AB + CD + *F/D +E*$ $ABCD + *F/DE* ++$ $A * B + CD/F *DE ++$ $A + *BCD/F* DE ++$
asked
Apr 18
in
DS
by
admin
(
193
points)

3
views
gate1995
datastructures
stack
easy
videosolution
0
votes
0
answers
GATE200438, ISRO200927 Video Solution
Assume that the operators $+, , \times$ are left associative and $^\hat{}$ is right associative. The order of precedence (from highest to lowest) is $^\hat{}, \times, +, $. The postfix expression corresponding to the infix expression $a+ b \times cd^\hat{}e^\hat{}f$ ... $ab+c\times de^\hat{}f^\hat{}$ $+a\times bc^\hat{}{}^\hat{}def$
asked
Apr 18
in
DS
by
admin
(
193
points)

4
views
gate2004
stack
isro2009
videosolution
0
votes
0
answers
GATE2015312 Video Solution
The result evaluating the postfix expression $10 \ 5 + 60 \ 6 / * 8 $ is $284$ $213$ $142$ $71$
asked
Apr 18
in
DS
by
admin
(
193
points)

33
views
gate20153
datastructures
stack
normal
videosolution
0
votes
0
answers
GATE199819b Video Solution
Compute the post fix equivalent of the following expression $3^*\log(x+1)\frac{a}{2}$
asked
Apr 18
in
DS
by
admin
(
193
points)

7
views
gate1998
stack
infixprefix
videosolution
0
votes
0
answers
GATE2015238 Video Solution
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; case 0: if (stkTop < size ) A[stkTop++]=val; break; default: if ... (0, 10); printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0)); } The value printed by the above program is ________.
asked
Apr 18
in
DS
by
admin
(
193
points)

4
views
gate20152
datastructures
stack
easy
numericalanswers
videosolution
0
votes
0
answers
GATE19961.12 Video Solution
Consider the following statements: Firstinfirst out types of computations are efficiently supported by STACKS. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations. Implementing QUEUES on a circular array is more ... and $(ii)$ are true $(iii)$ and $(iv)$ are true $(ii)$ and $(iv)$ are true
asked
Apr 18
in
DS
by
admin
(
193
points)

7
views
gate1996
datastructures
easy
queue
stack
linkedlists
videosolution
0
votes
0
answers
GATE20045 Video Solution
The best data structure to check whether an arithmetic expression has balanced parentheses is a queue stack tree list
asked
Apr 18
in
DS
by
admin
(
193
points)

2
views
gate2004
datastructures
easy
stack
videosolution
0
votes
0
answers
GATE19971.7 Video Solution
Which of the following is essential for converting an infix expression to the postfix form efficiently? An operator stack An operand stack An operand stack and an operator stack A parse tree
asked
Apr 18
in
DS
by
admin
(
193
points)

8
views
gate1997
normal
infixprefix
stack
datastructures
videosolution
0
votes
0
answers
GATE200013 Video Solution
Suppose a stack implementation supports, in addition to PUSH and POP, an operation REVERSE, which reverses the order of the elements on the stack. To implement a queue using the above stack implementation, show how to implement ENQUEUE using a single operation and DEQUEUE using a sequence ... $5 \ 2 * 3 \ 4 + 5 \ 2$ At the end of evaluation
asked
Apr 18
in
DS
by
admin
(
193
points)

5
views
gate2000
datastructures
stack
normal
descriptive
videosolution
0
votes
0
answers
GATE199426 Video Solution
A queue $Q$ containing $n$ items and an empty stack $S$ are given. It is required to transfer all the items from the queue to the stack, so that the item at the front of queue is on the TOP of the stack, and the order of all other ... which can be performed on the queue and stack are Delete, Insert, Push and Pop. Do not assume any implementation of the queue or stack.
asked
Apr 18
in
DS
by
admin
(
193
points)

4
views
gate1994
datastructures
queue
stack
normal
videosolution
0
votes
0
answers
GATE2007IT32 Video Solution
Consider the following C program: #include <stdio.h> #define EOF 1 void push (int); /* push the argument on the stack */ int pop (void); /* pop the top of the stack */ void flagError (); int main () { int c, m, n, r; while ((c = getchar ()) != EOF) { if ... is the output of the program for the following input? $5 \ 2 \ * \ 3 \ 3 \ 2 \ + * +$ $15$ $25$ $30$ $150$
asked
Apr 18
in
DS
by
admin
(
193
points)

6
views
gate2007it
stack
normal
videosolution
0
votes
0
answers
GATE2004IT52 Video Solution
A program attempts to generate as many permutations as possible of the string, '$abcd$' by pushing the characters $a, b, c, d$ in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program? $abcd$ $dcba$ $cbad$ $cabd$
asked
Apr 18
in
DS
by
admin
(
193
points)

3
views
gate2004it
datastructures
normal
stack
videosolution
0
votes
0
answers
GATE199103,vii Video Solution
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The following sequence of operations is performed on a stack: PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP The sequence of values popped out is $20,10,20,10,20$ $20,20,10,10,20$ $10,20,20,10,20$ $20,20,10,20,10$
asked
Apr 18
in
DS
by
admin
(
193
points)

5
views
gate1991
datastructures
stack
easy
videosolution
+1
vote
0
answers
#data structute
Q.how many stack are required to calculate prefix and postfix expression?
asked
Dec 17, 2019
in
DS
by
amit166
(
87
points)

11
views
stack
0
votes
1
answer
Self Doubt; Algorithms
A programmer wants to create a dynamic array implementation of stack in which always a new array of size n+10 is created every time the array cannot accommodate more elements. For example, for inserting the first element, array of size 0+10=10 will be created. After ... this new array. What is the time complexity of this stack implementation? O(n) O(log n) O(nlog n) O(1)
asked
Jul 20, 2019
in
Algorithms
by
Sambhrant Maurya
(
481
points)

43
views
algorithms
timecomplexity
datastructures
stack
To see more, click for the
full list of questions
or
popular tags
.
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Recent Posts
New GATEOverflow PDFs
Guidelines to users
Recent Blog Comments
Thanks, Can you tell me till when this might get...
8,446
questions
2,720
answers
13,274
comments
95,468
users