wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Structures Final Exam

Total questions: 30

Worksheet time: 18mins

Name
Class
Date
1.
1. Which of the following best describes a stack data structure?
a)
First In, First Out (FIFO)
b)
Last In, First Out (LIFO)
c)
Random Access
d)
Sorted Access
2.
2. What operation is used to add an element to a stack?
a)
Push
b)
Pop
c)
Enqueue
d)
Dequeue
3.
3. What operation is used to remove an element from a stack?
a)
Push
b)
Pop
c)
Enque
d)
Dequeue
4.
4. Which of the following is NOT a typical application of a stack?
a)
Undo mechanism in text editors
b)
Function call management
c)
CPU scheduling
d)
Expression evaluation
5.
5. Which data structure is used to implement recursion?
a)
Queue
b)
Stack
c)
Tree
d)
Array
6.
6. Which of the following is a real-world example of a stack?
a)
A line of people waiting for a bus
b)
A pile of plates in a cafeteria
c)
A printer queue
d)
A list of songs in a playlist
7.
7. Which of the following is true about a stack?
a)
Elements can be accessed from any position
b)
Only the topmost element can be accessed
c)
Elements are always sorted
d)
The bottommost element is always removed first
8.
8. Which operation checks if a stack is empty?
a)
Push
b)
Pop
c)
IsEmpty
d)
IsFull
e)
Opsyon 5
9.
9. What is the main characteristic of a tree data structure?
a)
Linear
b)
Hierarchical
c)
Circular
d)
Random
10.
10. What is the topmost node in a tree called?
a)
Leaf
b)
Root
c)
Parent
d)
Child
11.
11. What is a node with no children called?
a)
Root
b)
Parent
c)
Leaf
d)
Branch
12.
12. What is the number of children a node has called?
a)
Height
b)
Depth
c)
Degree
d)
Level
13.
13. What is the depth of the root node?
a)
0
b)
1
c)
-1
d)
2
14.
14. What is the height of a leaf node (non‑empty tree)?
a)
0
b)
1
c)
-1
d)
2
15.
15. Which traversal visits the root first, then left subtree, then right subtree?
a)
Inorder
b)
Preorder
c)
Postorder
d)
Level order
16.
16. Which traversal visits the left subtree, then the root, then the right subtree?
a)
Inorder
b)
Preorder
c)
Postorder
d)
Level order
17.
17. What is a tree where each node has at most two children called?
a)
Binary tree
b)
General tree
c)
Forest
d)
Linked list
18.
18. What is a binary tree where all levels except possibly the last are completely filled called?
a)
Full binary tree
b)
Complete binary tree
c)
Perfect binary tree
d)
Degenerate tree
19.
19. What is a binary tree where every node has 0 or 2 children called?
a)
Full binary tree
b)
Complete binary tree
c)
Perfect binary tree
d)
Degenerate tree
20.
20. What is the topmost node in any tree structure called?
a)
Leaf
b)
Roof
c)
Child
d)
Siblings
21.

21. Is a non-linear abstract data type with a hierarchy-based structure.

(a)  

22.

22. refers to the sequence of nodes along the edges of tree, starting from specific nodes and leading to another node within a tree.

(a)  

23.

23. the number of edges on the longest path from that node to any leaf in its subtree.

(a)  

24.

24. are values stored in the nodes of a tree that help in identifying and accessing data.

(a)  

25.

25. is a hierarchical data structure in which each node has at most two children, referred to as the left child and the right child.

(a)  

26.

26. Refers to the process of visiting each node in the tree in a specific order.

(a)  

27.

27. Is the node that is the furthest from the root. It is typically the node that appears at the last level of the tree, and if there are multiple nodes at that level, the deepest node is the one that is farthest to the right (in the case of a level-order traversal).

(a)  

28.

28. Is a special type of binary tree where insertion takes place level by level and from left to right at each level.

(a)  

29.

29. All levels are fully filled except possibly the last, which is filled from left to right.

(a)  

30.

30. Is a special kind of data structure used in computer science to organize and manage data in a way that makes it easy to search for, add, or remove items. Let’s break this down in simple terms.

(a)