Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for stack
49
votes
7
answers
1
GATE CSE 1995 | Question: 2.21
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 ++$
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 ++$
Kathleen
38.3k
views
Kathleen
asked
Oct 8, 2014
DS
gate1995
data-structures
stack
easy
+
–
88
votes
8
answers
2
GATE CSE 2006 | Question: 49
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 (stack-empty(S2)) then if (stack-empty(S1)) then { print( Q is empty ); return; } else while (!(stack-empty(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 $
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 (stack-empty(S2)) then if (sta...
Rucha Shelke
33.0k
views
Rucha Shelke
asked
Sep 26, 2014
DS
gatecse-2006
data-structures
queue
stack
normal
+
–
56
votes
5
answers
3
GATE CSE 1997 | Question: 4.7
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 ... For a sequence of operations, the keys chosen are in non-increasing order non-decreasing order strictly increasing order strictly decreasing order
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 ...
Kathleen
24.5k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
stack
normal
priority-queue
+
–
54
votes
9
answers
4
GATE CSE 2014 Set 2 | Question: 41
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{POP}$ ... instruction. A queue can be implemented where both $\text{ENQUEUE}$ and $\text{DEQUEUE}$ take a single instruction each.
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{PO...
go_editor
24.8k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set2
data-structures
stack
easy
+
–
48
votes
6
answers
5
GATE CSE 2004 | Question: 3
A single array $A[1 \ldots \text{MAXSIZE}]$ is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables $top1$ and $top2$ $(top1 < top 2)$ point to the location of the topmost element in each of the stacks. If the space is to ... $(top1 = \text{MAXSIZE} / 2)$ or $(top2 = \text{MAXSIZE})$ $top1 = top2 - 1$
A single array $A[1 \ldots \text{MAXSIZE}]$ is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables $top1$ and $top2$ $(top1 < top...
Kathleen
35.4k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
stack
easy
+
–
22
votes
7
answers
6
GATE CSE 2001 | Question: 2.16
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$? One Two Three Four
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$?OneTwoThreeFour
Kathleen
24.3k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
easy
stack
queue
+
–
89
votes
12
answers
7
GATE CSE 2003 | Question: 64
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 ... S. The average stack-life of an element of this stack is $n(X+Y)$ $3Y+2X$ $n(X+Y)-X$ $Y+2X$
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 th...
Kathleen
31.1k
views
Kathleen
asked
Sep 17, 2014
DS
gatecse-2003
data-structures
stack
normal
+
–
33
votes
6
answers
8
GATE CSE 1994 | Question: 1.14
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}$
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...
Kathleen
33.3k
views
Kathleen
asked
Oct 4, 2014
DS
gate1994
data-structures
stack
normal
+
–
32
votes
5
answers
9
GATE CSE 2004 | Question: 38, ISRO2009-27
Assume that the operators $+, -, \times$ are left associative and $^\hat{}$ is right associative. The order of precedence (from highest to lowest) is $ \ ^\hat{}, \times, +, -$ ... $-+a\times bc \ \ \hat{} \ \ \ \hat{} \ \ def$
Assume that the operators $+, -, \times$ are left associative and $^\hat{}$ is right associative. The order of precedence (from highest to lowest) is $ \ ^\hat{}, \times,...
Kathleen
12.9k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
stack
isro2009
infix-prefix
+
–
33
votes
4
answers
10
GATE CSE 1996 | Question: 1.12
Consider the following statements: First-in-first 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 ... $(ii)$ are true $(iii)$ and $(iv)$ are true $(ii)$ and $(iv)$ are true
Consider the following statements:First-in-first out types of computations are efficiently supported by STACKS.Implementing LISTS on linked lists is more efficient than i...
Kathleen
14.9k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
easy
queue
stack
linked-list
+
–
6
votes
3
answers
11
GATE CSE 2023 | Question: 49
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 empty. $\textsf{push}$ the ... $S$. $\textsf{pop}$ an element from $S$. The top element of $S$ after executing the above operations is ______________.
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,$ b...
admin
6.9k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
stack
numerical-answers
2-marks
easy
+
–
7
votes
1
answer
12
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 45
Consider a stack whose elements are unsigned integers and support the following operations: PUSH a: Pushes the element 'a' onto the stack. ADD: Adds the two topmost elements, removes them, and pushes the result. SQR: ... once, count it as many times as it is used. Your final count should include initial 3 PUSH instructions.
Consider a stack whose elements are unsigned integers and support the following operations:PUSH a: Pushes the element 'a' onto the stack.ADD: Adds the two topmost element...
GO Classes
530
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
numerical-answers
data-structures
stack
2-marks
+
–
1
votes
1
answer
13
GATE CSE 2024 | Set 2 | Question: 38
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ already has $4$ elements: $100,200,300$, and $400$ ... output sequences can be generated by using the above operations? $100,200,400,300$ $200,300,400,100$ $400,200,100,300$ $300,200,400,100$
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ ...
Arjun
2.0k
views
Arjun
asked
Feb 16
DS
gatecse2024-set2
data-structures
stack
multiple-selects
+
–
33
votes
4
answers
14
GATE CSE 2007 | Question: 38, ISRO2016-27
The following postfix expression with single digit operands is evaluated using a stack: $8 \ 2 \ 3 \ {}^\hat{} ∕ \ 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$
The following postfix expression with single digit operands is evaluated using a stack:$$8 \ 2 \ 3 \ {}^\hat{} ∕ \ 2 \ 3 * + 5 \ 1 * -$$Note that $^\hat{}$ is the ex...
Kathleen
16.6k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
stack
normal
infix-prefix
isro2016
+
–
0
votes
1
answer
15
Memory Based GATE DA 2024 | Question: 40
Match the following: $ \begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & (ii) Queue \\ \hline Look Up & (i) Hash Table\\ \hline LIFO & (iii) Stack \\ \hline \end{array} $
Match the following:$$\begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & ...
GO Classes
184
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
stack
+
–
2
votes
1
answer
16
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 4
What are the sequence of popped-out values if the sequence of operations - $\textsf{push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop}$ are performed on a stack? $2, 2, 1, 1, 2$ $2, 2, 1, 1, 1$ $2, 1, 2, 2, 1$ $2, 1, 2, 2, 2$
What are the sequence of popped-out values if the sequence of operations - $\textsf{push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop}$ are performed o...
GO Classes
337
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
data-structures
stack
1-mark
easy
+
–
0
votes
1
answer
17
What is the infix to postfix evaluation of (A+B)*(C*D - E)*F / G
According to my knowledge, it should be AB+CD*E-*F*G/ And, here is the step-wise explanation of it Converting the bracket of (A+B) - AB+ There is operator but the next operand is entire bracket term, it has to be ... Please confirm if my logic and answer is correct or not. Note Mind the space around / operator. It is there on purpose.
According to my knowledge, it should be AB+CD*E-*F*G/And, here is the step-wise explanation of itConverting the bracket of (A+B) – AB+There is operator but the next ope...
tbhaxor
842
views
tbhaxor
asked
Nov 24, 2023
DS
stack
infix-prefix
+
–
10
votes
3
answers
18
GATE CSE 2021 Set 1 | Question: 21
Consider the following sequence of operations on an empty stack.$\textsf{push}(54);\textsf{push}(52);\textsf{pop}();\textsf{push}(55);\textsf{push}(62);\textsf{s}=\textsf{pop}();$ ... $\textsf{s+q}$ is ___________.
Consider the following sequence of operations on an empty stack.$$\textsf{push}(54);\textsf{push}(52);\textsf{pop}();\textsf{push}(55);\textsf{push}(62);\textsf{s}=\texts...
Arjun
8.3k
views
Arjun
asked
Feb 18, 2021
DS
gatecse-2021-set1
data-structures
stack
easy
numerical-answers
1-mark
+
–
27
votes
6
answers
19
GATE CSE 2015 Set 3 | Question: 12
The result evaluating the postfix expression $10 \ 5 + 60 \ 6 / * 8 -$ is $284$ $213$ $142$ $71$
The result evaluating the postfix expression $10 \ 5 + 60 \ 6 / * 8 -$ is $284$$213$$142$$71$
go_editor
13.0k
views
go_editor
asked
Feb 14, 2015
DS
gatecse-2015-set3
data-structures
stack
normal
+
–
44
votes
9
answers
20
GATE CSE 1998 | Question: 19b
Compute the post fix equivalent of the following expression $3^*\log(x+1)-\frac{a}{2}$
Compute the post fix equivalent of the following expression $3^*\log(x+1)-\frac{a}{2}$
Arjun
15.7k
views
Arjun
asked
Aug 29, 2015
DS
gate1998
stack
infix-prefix
descriptive
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register