Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Structures

Total questions: 12

Worksheet time: 11mins

Name
Class
Date
1.

Matrix A - p rows, q columns

Matrix B - s rows, t columns

if ((p !=s) && (q!=t)) - Then what will happen for Addition of Matrix A and B?

(a)  

2.

Consider the following statements in a Queue:

enqueue(8);

enqueue(2);

enqueue(6);

enqueue(4);

dequeue();

enqueue(5);

What is the current size of the queue?

a)

5

b)

6

c)

4

d)

3

3.

If the elements P, W,S,D are placed in a stack and are deleted one at a time, what is the order of removal?

a)

PWSD

b)

PDWS

c)

DWSP

d)

DSWP

4.

Write the postfix notation of the following infix expression.

A+B*C+(D*E+F)*G

(a)  

5.

Write only the function to delete a node at the beginning of a doubly linked list.

4 lines
6.

Queue Implementation using Array. Array name is Queuearray and rear is the current element pointer and "data" is the new item to be added. For adding a new element int the queue, is the following statement correct?

queue[rear] = data;

Queuearray[rear] = data;

a)

True

b)

False

7.

An exam was attended by 80 students. Min marks-0, Max Mark-50. I need to store the frequency of marks >30. What will be the size of the array needed for it?

a)

80

b)

20

c)

30

d)

50

8.

Below is a stack operation

int x = a[top--];

return x;

if top becomes zero, then what is that condition called?

a)

overflow

b)

underflow

c)

pop

d)

push

9.

Write the condition to check whether a queue is full or not?

(rear, front are the pointers, size of the array =MAX)

(a)  

10.

What is the way to increment the rear end of a circular queue?

a)

(Rear+1) mod MAX

b)

Rear mod MAX

c)

(Front+1) mod MAX

d)

(Rear-1) mod MAX

11.

Write the function to insert a node to the beginning of a singly linked list?

4 lines
12.

The front and rear pointers of a queue are monitored in a linked list implementation. During an insertion into a NONEMPTY queue, which of these pointers would change?

a)

Only rear pointer

b)

Only Front pointer

c)

Both Front and Rear