Data Structures :: Stacks

Home > Technical Aptitude > Data Structures > Stacks > General Questions

NA
SHSTTON
29
Solv. Corr.
47
Solv. In. Corr.
76
Attempted
0 M:0 S
Avg. Time

1 / 37

The five items: A,B,C,D and E are pushed in stack, one after the other starting from A. The stack is

Is popped four items and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack . Now one item is popped from the stack.

The popped item is.


AA

BB

CC

DD

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
37
Solv. Corr.
27
Solv. In. Corr.
64
Attempted
0 M:0 S
Avg. Time

2 / 37

Convert the infix to postfix for A-(B+C)*(D/E)


AABC+DE/*-

BABC-DE/*-

CABC-DE*/-

DNone of the above

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
27
Solv. Corr.
22
Solv. In. Corr.
49
Attempted
0 M:0 S
Avg. Time

3 / 37

What is the postfix form of the following prefix expression -A/B*C$DE


AABCDE$*/-

BA-BCDE$*/-

CABC$ED*/-

DA-BCDE$*/

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
15
Solv. Corr.
32
Solv. In. Corr.
47
Attempted
0 M:0 S
Avg. Time

4 / 37

The minimum number of multiplications and additions required to evaluate the polynomial
P = 4x^3+3x^2-15x+45 is


A6&3

B4&2

C3&3

D8&3

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
52
Solv. Corr.
6
Solv. In. Corr.
58
Attempted
0 M:0 S
Avg. Time

5 / 37

The data structure required to evaluate a postfix expression is


Aqueue

Bstack

Carray

Dlinked-list

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
48
Solv. Corr.
9
Solv. In. Corr.
57
Attempted
0 M:3 S
Avg. Time

6 / 37

The data structure required to check whether an expression contains balanced parenthesis is


AStack

BQueue

CTree

DArray

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
40
Solv. Corr.
16
Solv. In. Corr.
56
Attempted
0 M:0 S
Avg. Time

7 / 37

The process of accessing data stored in a serial access memory is similar to manipulating data on a


Aheap

Bqueue

Cstack

Dbinary tree

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
20
Solv. Corr.
28
Solv. In. Corr.
48
Attempted
0 M:0 S
Avg. Time

8 / 37

The postfix form of the expression is (A+B) * (C*D-E)*F/G is


AAB+CD*E-FG/**

BAB+CD*E-*F*G/

CAB+CD*E-F**G/

DAB+CDE*-*F*G/

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
18
Solv. Corr.
38
Solv. In. Corr.
56
Attempted
0 M:0 S
Avg. Time

9 / 37

The pre-order and post order traversal of a Binary Tree generates the same output. The tree can have maximum


AThree nodes

BTwo nodes

COne node

DAny number of nodes

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
39
Solv. Corr.
8
Solv. In. Corr.
47
Attempted
0 M:0 S
Avg. Time

10 / 37

What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?


AStack

BLinked list

CQueue

DTrees

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace