wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

dsa quiz

Total questions: 6

Worksheet time: 3mins

Name
Class
Date
1.

A tree with no nodes is called a ______.




a)

a) Null tree

b)

b) Empty tree

c)

Zero tree

d)

d) Leaf tree

2.

Which traversal of a binary tree gives nodes in sorted order (if the tree is BST)?

a)

Preorder

b)

Postorder

c)

Inorder

d)

Level order

3.

Which data structure works on LIFO principle

a)

a) Queue

b)

b) Stack

c)

c) Array

d)

) Linked List

4.

In a queue, insertion happens at the ______.

a)

rear

b)

front

c)

middle

d)

top

5.

Which is the correct formula for the number of edges in a tree with n nodes?





a)

a) n

b)

b) n + 1

c)

c) n – 1

d)

d) 2n

6.

In array deletion, time complexity is ______.





a)

a) O(1)

b)

b) O(log n)

c)

c) O(n)

d)

d) O(n²)