Prime

#### Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

#### Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

# Stacks and Queues Questions for Mphasis

Question 1

Time: 00:00:00
Each step in the evaluation of an Infix expression refers to the encounter of a token. In the evaluation of the fully parenthesized Infix expression -
((1*2)+4-((7*6)/(8-9)))
Which of the following options shows the contents of the Stack after 7th step

((*)+-(

((*)+-(

((1*2)+

((1*2)+

((2+

((2+

(2+4

(2+4

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 2

Time: 00:00:00
Consider the given conditions in regards to the circular queue
1) (FRONT = 0) and (REAR =CAPACITY - 1)
2) FRONT = REAR
3)FRONT = CAPACITY-- REAR
Which of the above conditions tests the overflow condition of a circular queue?

Only l

Only l

Only2

Only2

Only 3

Only 3

Both l and 2

Both l and 2

Both l and 3

Both l and 3

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 3

Time: 00:00:00
Group A

Group B
1. Constant
2. Arrays
3. Loops
4. Pointers

1) A-4.B-3, C-2, D-1

1) A-4.B-3, C-2, D-1

A-3.B-2, C-4, D-1

A-3.B-2, C-4, D-1

A-2,B-1,C-4,D-3

A-2,B-1,C-4,D-3

A-4,B-1,C-2,D-3

A-4,B-1,C-2,D-3

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 4

Time: 00:00:00
Stack is useful for implementing

Recursion

Recursion

None of these

None of these

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 5

Time: 00:00:00
Which of the following data structure may give overflow error, even though the current number of element in it is less than its size?

Queue implemented in a linear array

Queue implemented in a linear array

Queue implemented in a circularly connected array

Queue implemented in a circularly connected array

Stack implemented in a linear array

Stack implemented in a linear array

none of these

none of these

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 6

Time: 00:00:00
A is an empty stack. The following operations are done on it.
PUSH(1)
PUSH(2)
POP
PUSH(5)
PUSH(6)
POP
What will the stack contain after these operations. (Top of the stack is underlined)

_5_ 6

_5_ 6

1 _5_

1 _5_

_5_ 6

_5_ 6

_1_ 5

_1_ 5

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 7

Time: 00:00:00
A stack is implemented as a linear array A[0…N-1]. Noor writes the following functions for popping
an element from the stack.
function POP( top, N )
{
if(X)
{
top = top - 1
}
else
{
print "Underflow"
}
}
Fill in the condition X

top< N-1

top< N-1

top

top

top>1

top>1

top >= 0

top >= 0

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 8

Time: 00:00:00
How many stack/s need for implementing a queue?

2

2

3

3

1

1

5

5

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 9

Time: 00:00:00
A queue is implemented by a linear array of size 10 (and not as a circularly connected array). Front and Rear are represented as an index in the array. To add an element, the rear index is incremented and the element is added. To delete an element, the front index is incremented. The following operations are done on an empty queue.
After this set of operations, what is the maximum capacity of the queue?

6

6

7

7

10

10

None

None

Once you attempt the question then PrepInsta explanation will be displayed.

Start

Question 10

Time: 00:00:00
how many arrays are required to implement a priority queue?

1

1

2

2

3

3

4

4

Once you attempt the question then PrepInsta explanation will be displayed.