wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Structure

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

The stack uses which policy out of the following

a)

LIFO

b)

FIFO

c)

FILO

d)

NONE

2.

(a)   is very useful in situation when data have to stored and then retrieved in reverse order.

3.

The post fix form of (A + B) *C is

a)

AB+ C*

b)

ABC*+

c)

ABC*+

d)

ABC*+

4.

Given a prefix and a postfix notation what are the difference between them?

a)

The postfix equation is solved starting from the right whereas the prefix notation is solved from the left

b)

The postfix equation is solved starting from the left whereas the prefix notation is solved from the right

c)

The postfix equation is solved starting from the left whereas the prefix notation is solved from the right

d)

The postfix equation is solved starting from the left whereas the prefix notation is solved from the left

5.

The result of evaluating the postfix expression 5,4,6,+,*,4,9,3,/,+,* is

a)

600

b)

250

c)

400

d)

350

6.

Which one of the following is an application of Stack Data Structure?

a)

Managing function calls

b)

Arithmetic expression evaluation

c)

CPU Scheduling

d)

All of the above

7.

Consider the following pseudocode that uses a stack

declare a stack of characters

while ( there are more characters in the word to read ){

{

read a character

push the character on the stack

}

while ( the stack is not empty )

{ pop a character off the stack

write the character to the screen

}

What is output for input "computer"?

a)

computer

b)

computercomputer

c)

retupmocretupmoc

d)

retupmoc

8.

The following postfix expression with single digit operands is evaluated using a stack:

8 2 3 ^ / 2 3 * + 5 1 * -

a)

6,1

b)

3,2

c)

5,7

d)

1,5

9.

The prefix form of A-B/ (C * D ^ E) is?

a)

-/*^ACBDE

b)

-ABCD*^DE

c)

-A/B*C^DE

d)

-A/BC*^DE

10.

what will be the result of the below given expression in prefix form

- + 2 3 8

a)

-3

b)

7

c)

3

d)

-7