wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DSA5541 Quiz 1 TRI 2210

Total questions: 20

Worksheet time: 3600secs

Name
Class
Date
1.

Mathematical-model with a collection of operations defined on that model is called

a)

Data Structure

b)

Abstract Data Type

c)

Primitive Data Type

d)

Algorithm

2.

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

a)

AB+ CD*E - FG /**

b)

AB + CD* E - F **G /

c)

AB + CD* E - *F *G /

d)

AB + CDE * - * F *G /

3.

A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a

a)

queue.

b)

stack.

c)

tree.

d)

linked list.

4.

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

a)

ABCDE/*/-

b)

A-BCDE/*/-

c)

ABC/ED*/-

d)

A-BCDE/*/

5.

The data structure required to evaluate a postfix expression is

a)

queue

b)

stack

c)

array

d)

linked-list

6.

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

a)

Stack

b)

Queue

c)

Tree

d)

Array

7.

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

a)

Stack

b)

Linked list

c)

Queue

d)

Trees

8.

The postfix form of A*B+C/D is

a)

*AB/CD+

b)

AB*CD/+

c)

A*BC+/D

d)

ABCD+/*

9.

Let the following circular queue can accommodate maximum six elements with the following data

front = 2 rear = 4

current elements : ‘L’, ‘M’, ‘N’

What will happen after ADD ‘O’ operation takes place?

a)

front = 2 rear = 5

b)

front = 3 rear = 5

c)

front = 3 rear = 4

d)

front = 2 rear = 4

10.

Assume that a queue is available for enqueue and dequeue elements. Given an inputs are A, B, C. Give the output sequence of elements if the leftmost element

given is at rear position and the rightmost element is at front position in the queue.

a)

BCA

b)

ABC

c)

CBA

d)

BAC

11.

A queue is a,

a)

Linear tree.

b)

LIFO (Last In First Out) list.

c)

Ordered array.

d)

FIFO (First In First Out) list.

12.

Which of the following operations is backward manner performed by linked list?

a)

New node are always inserted at the end.

b)

New node is always inserted at the beginning.

c)

Pointer head must always point to the last node in the list or else the rest of the nodes will be lost.

d)

Pointer head must always point to the current node in the list or else the rest of the nodes will be lost.

13.

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

a)

-/*^ACBDE

b)

-ABCD*^DE

c)

-A/B*C^DE

d)

-A/BC*^DE

14.

The prefix form of an infix expression p + q - r * t is

a)

+ pq - *rt

b)

- +pqr * t

c)

- +pq * rt

d)

- + * pqrt

15.

The equivalent prefix expression for the following infix expression (A+B)-(C+D*E)/F*G is

a)

-+AB*/+C*DEFG

b)

/-+AB*+C*DEFG

c)

-/+AB*+CDE*FG

d)

-+AB*/+CDE*FG

16.

Convert the infix (a+b)*(c+d)/f into postfix

a)

*a b + c d + f /

b)

a b + c d + * f /

c)

a b + c d +/ * f

d)

+a b + c d / * f

17.

Based on the diagram 1, values 40, 50 and 60 are push in the stack. Then there are two values pop out from the stack. What is the final answer for the topstack?

a)

1

b)

2

c)

4

d)

5

18.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable z?

a)

7

b)

4

c)

3

d)

14

19.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable *p?

a)

7

b)

4

c)

3

d)

14

20.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable array?

a)

5,4

b)

3,4

c)

4,7

d)

4,5