Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged stack
2
votes
3
answers
211
MadeEasy Test Series: Programming & DS - Infix Postfix
Consider the following expression with infix notation A * B - (C + D) * (E / 5) ^ F What is the maximum height of the operator stack during conversion from infix to postfix ? a) 3 b) 4 c) 5 d) 6
Consider the following expression with infix notationA * B - (C + D) * (E / 5) ^ F What is the maximum height of the operator stack during conversion from infix to postfi...
Tushar Shinde
3.7k
views
Tushar Shinde
asked
Jan 28, 2016
DS
made-easy-test-series
data-structures
stack
infix-prefix
+
–
3
votes
3
answers
212
check the question
consider the following infix expression which is to be converted to postfix expression using stack. (((P+Q)*(R+S))/T)+(A*(B+C)) The sum of all unique possible heights of stack when converting infix to postfix is______ ans given:15 but i am getting 19.is this correct?
consider the following infix expression which is to be converted to postfix expression using stack.(((P+Q)*(R+S))/T)+(A*(B+C))The sum of all unique possible heights of st...
pritika kundu
2.8k
views
pritika kundu
asked
Jan 15, 2016
Programming in C
stack
numerical-answers
+
–
1
votes
2
answers
213
Infix expression evaluation complexity
What is the complexity of evaluating an infix expression having n operators?
What is the complexity of evaluating an infix expression having n operators?
bahirNaik
2.8k
views
bahirNaik
asked
Dec 11, 2015
Programming in C
stack
algorithms
time-complexity
+
–
3
votes
1
answer
214
What Happens If Interrupt raised while execution of a program to contents of PC
Consider following program MOV R1,5000 MOV R2,2000 ADD R2,R2,R3 //Interrupt raised here, Mem Add of this instruction is 1008 Now when ISR is served and program resumes from ADD instruction(1008), R1 ... stored before interuptt and replaced. case 2: Program begins execution from MOV R1,5000 after interuptt is served.
Consider following programMOV R1,5000MOV R2,2000ADD R2,R2,R3 //Interrupt raised here, Mem Add of this instruction is 1008 Now when ISR is served and program resumes f...
kartikey
853
views
kartikey
asked
Nov 29, 2015
CO and Architecture
interrupts
stack
+
–
20
votes
3
answers
215
TIFR CSE 2011 | Part B | Question: 29
You are given ten rings numbered from $1$ to $10$, and three pegs labeled $A$, $B$, and $C$. Initially all the rings are on peg $A$, arranged from top to bottom in ascending order of their numbers. The goal is to move all the rings to peg ... on top of another ring with a lower number. How many moves are required? $501$ $1023$ $2011$ $10079$ None of the above.
You are given ten rings numbered from $1$ to $10$, and three pegs labeled $A$, $B$, and $C$. Initially all the rings are on peg $A$, arranged from top to bottom in ascend...
makhdoom ghaya
2.9k
views
makhdoom ghaya
asked
Oct 22, 2015
Algorithms
tifr2011
data-structures
stack
tower-of-hanoi
+
–
2
votes
1
answer
216
evaluation of prefix expression takes O(n^2)....true?
admin
1.5k
views
admin
asked
Oct 19, 2015
DS
data-structures
stack
infix-prefix
time-complexity
+
–
1
votes
1
answer
217
Is stack pointer affected by conditional branch? If no, why?
A computer uses expanding opcode. It has 16 bit instructions 6 bit addresses, it supports one address, two address instructions only. If there are n two address instructions, the maximum number of one address instructions are?
A computer uses expanding opcode. It has 16 bit instructions 6 bit addresses, it supports one address, two address instructions only. If there are n two address instructi...
Tehreem
1.1k
views
Tehreem
asked
Sep 9, 2015
CO and Architecture
stack
co-and-architecture
+
–
44
votes
9
answers
218
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.8k
views
Arjun
asked
Aug 29, 2015
DS
gate1998
stack
infix-prefix
descriptive
+
–
0
votes
1
answer
219
Postfix expression for the following image ?
q.26 : I do not understand the output . Why are real , integer and to coming?
q.26 : I do not understand the output . Why are real , integer and to coming?
prasitamukherjee
564
views
prasitamukherjee
asked
Jul 16, 2015
DS
data-structures
stack
infix-prefix
+
–
4
votes
3
answers
220
UGC NET CSE | June 2014 | Part 2 | Question: 40
What is the maximum number of parenthesis that will appear on the stack at any one time for parenthesis expression given by $( ( ) \; ( ( ) ) \; ( ( ) ) )$ $2$ $3$ $4$ $5$
What is the maximum number of parenthesis that will appear on the stack at any one time for parenthesis expression given by$( ( ) \; ( ( ) ) \; ( ( ) ) ...
Shimpy Goyal
7.9k
views
Shimpy Goyal
asked
Jun 26, 2015
DS
ugcnetcse-june2014-paper2
data-structures
stack
+
–
0
votes
2
answers
221
Give an algorithm to finding duplicate parenthesis in a expression ?
suppose expression is like : ((a+b)+((c+d))), so how to find duplicate parenthesis in the given expression ?
suppose expression is like : ((a+b)+((c+d))), so how to find duplicate parenthesis in the given expression ?
anurag_am
1.3k
views
anurag_am
asked
Apr 29, 2015
DS
data-structures
stack
descriptive
+
–
0
votes
1
answer
222
If memory for the run-time stack is only 150 cells (words) how big can N be in Factorial(N) before encountering Stack overflow?
options are:a)24b)15c)66d)50
soorajchn
5.5k
views
soorajchn
asked
Mar 14, 2015
Programming in C
data-structures
stack
+
–
27
votes
6
answers
223
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
+
–
35
votes
4
answers
224
GATE CSE 2015 Set 2 | Question: 38
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 ... 0, 10); printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0)); } The value printed by the above program is ________.
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; brea...
go_editor
10.7k
views
go_editor
asked
Feb 12, 2015
DS
gatecse-2015-set2
data-structures
stack
easy
numerical-answers
+
–
0
votes
2
answers
225
For every push pop>3 units time required.
For every push pop>3 units time required. Do continuously 4 push afterward 4 pop. Then what is the average life time of stack.
For every push pop>3 units time required. Do continuously 4 push afterward 4 pop. Then what is the average life time of stack.
Shahid Rabbani
1.3k
views
Shahid Rabbani
asked
Jan 11, 2015
DS
stack
+
–
3
votes
1
answer
226
solve
Suppose that stacks and queues are provided as opaque data types, offering only operations to add elements, to remove elements, and to test for emptiness. Suppose that a programmer wants to count the number of elements in a given stack or queue $C$, which is currently in some state $t$, using only one ... queue and $D$ is a stack. None $1$ and $2$ only. $1$ and $3$ only. $1$, $2$ and $3$.
Suppose that stacks and queues are provided as opaque data types, offering only operations to add elements, to remove elements, and to test for emptiness. Suppose that a ...
Isha Karn
1.6k
views
Isha Karn
asked
Dec 10, 2014
DS
data-structures
stack
queue
+
–
67
votes
2
answers
227
GATE IT 2005 | Question: 13
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$
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...
Ishrat Jahan
17.6k
views
Ishrat Jahan
asked
Nov 3, 2014
DS
gateit-2005
data-structures
stack
normal
+
–
24
votes
1
answer
228
GATE IT 2004 | Question: 52
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$
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 ...
Ishrat Jahan
6.2k
views
Ishrat Jahan
asked
Nov 2, 2014
DS
gateit-2004
data-structures
normal
stack
+
–
25
votes
2
answers
229
GATE IT 2007 | Question: 32
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$
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 */ vo...
Ishrat Jahan
6.9k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2007
stack
normal
+
–
33
votes
4
answers
230
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
15.0k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
easy
queue
stack
linked-list
+
–
49
votes
7
answers
231
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
+
–
32
votes
3
answers
232
GATE CSE 1994 | Question: 26
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.
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 ...
Kathleen
7.5k
views
Kathleen
asked
Oct 5, 2014
DS
gate1994
data-structures
queue
stack
normal
descriptive
+
–
33
votes
6
answers
233
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.4k
views
Kathleen
asked
Oct 4, 2014
DS
gate1994
data-structures
stack
normal
+
–
56
votes
5
answers
234
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.6k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
stack
normal
priority-queue
+
–
28
votes
3
answers
235
GATE CSE 1997 | Question: 1.7
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
Which of the following is essential for converting an infix expression to the postfix form efficiently?An operator stackAn operand stackAn operand stack and an operator s...
Kathleen
8.7k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
normal
infix-prefix
stack
data-structures
+
–
54
votes
9
answers
236
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.9k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set2
data-structures
stack
easy
+
–
88
votes
8
answers
237
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.1k
views
Rucha Shelke
asked
Sep 26, 2014
DS
gatecse-2006
data-structures
queue
stack
normal
+
–
33
votes
4
answers
238
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
+
–
32
votes
5
answers
239
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
+
–
19
votes
4
answers
240
GATE CSE 2004 | Question: 5
The best data structure to check whether an arithmetic expression has balanced parentheses is a queue stack tree list
The best data structure to check whether an arithmetic expression has balanced parentheses is aqueuestacktreelist
Kathleen
7.1k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
easy
stack
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register