wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structure Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Given pointer to a node X in a singly linked list. Only one pointer is given, pointer to head node is not given, can we delete the node X from given linked list?

a)

Possible if X is not last node. Use following two steps (a) Copy the data of next of X to X. (b) Delete next of X.

b)

Possible if size of linked list is even.

c)

Possible if size of linked list is odd

d)

Possible if X is not first node. Use following two steps (a) Copy the data of next of X to X. (b) Delete next of X

2.

Queue is ____

a)

fifo

b)

Lifi

c)

Both a and b

d)

None of these

3.

Tree is ____data structure

a)

Linear

b)

Non linear

c)

Array

d)

List

4.

Which of the following points is/are true about Linked List data structure when it is compared with array

a)

Arrays have better cache locality that can make them better in terms of performance.

b)

It is easy to insert and delete elements in Linked List

c)

Random access is not allowed in a typical implementation of Linked Lists

d)

All of the above

5.

You are given pointers to first and last nodes of a singly linked list, which of the following operations are dependent on the length of the linked list?

a)

Delete the first element

b)

Insert a new element as a first element

c)

Delete the last element of the list

d)

Add a new element at the end of the list

6.

In the stack, If user try to remove element from the empty stack then it called as ___________.

a)

Overflow of Stack

b)

Empty Collection

c)

Underflow of Stack

d)

Garbage Collection

7.

In order to keep track of current topmost element of the stack we need to maintain one variable.

a)

Yes

b)

No

c)

Both Yes and No

d)

None of the answer

8.

Select a real life situation implement stack

a)

All of the answers

b)

The cars a garage the first car in will be the last car out of the garage

c)

The batteries in a flashlight

d)

The person wear bangles

9.

Which of the following is true about linked list implementation of stack?

a)

In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.

b)

In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.

c)

Both of the above

d)

None of the above

10.

The middle elements of a stack should not be accessed directly

a)

true

b)

false