wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITCC104: FINAL EXAMINATION

Total questions: 76

Worksheet time: 41mins

Name
Class
Date
1.

Why is Bubble Sort called “Bubble” Sort?

a)

It uses a heap-like structure.

b)

It divides the array in half repeatedly.

c)

Larger values the top as they swap

d)

It selects the minimum value and moves it to the front.

2.

What makes Insertion Sort efficient for nearly sorted arrays?

a)

It always runs in O(n²) time regardless of input.

b)

It uses a binary tree to store values.

c)

It performs fewer comparisons and shifts when data is nearly sorted

d)

It divides the array using pivot elements.

3.

How does Selection Sort differ from Bubble Sort in process?

a)

Bubble Sort selects the smallest item directly.

b)

Selection Sort finds the smallest and swaps it once per pass

c)

Bubble Sort only works on even-sized arrays.
d. Selection Sort only works with strings.

d)

Selection Sort only works with strings.

4.

What does the divide-and-conquer approach mean in Merge Sort?

a)

It swaps values from left to right.

b)

It places maximum values at the end.

c)

It breaks the array into parts, sorts them, and merges

d)

It deletes half of the data in each step.

5.

Which characteristic best explains why Heap Sort is not a stable algorithm?

a)

The rearrangement in heap structure changes equal elements' order

b)

It merges elements too quickly.

c)

It sorts elements without comparison.

d)

It adds new values during the sorting process.

6.

How does Quick Sort choose where to divide the list?

a)

Based on the largest value in the array

b)

It picks a pivot and partitions around it

c)

It uses the mean of the array

d)

It randomly swaps elements

7.

In what situation would Merge Sort be preferred over Quick Sort?

a)

When the data is small

b)

When stability is not important

c)

When consistent performance is needed in worst-case scenarios

d)

When memory usage is a major concern

8.

Why is Heap Sort suitable for large datasets with no memory constraints?

a)

It has the fastest time in all cases

b)

It guarantees O(n log n) time and doesn’t require stability

c)

It uses recursion to store values

d)

It modifies the input data completely

9.

What concept explains how Insertion Sort places each element in its correct location?

a)

Bubble logic

b)

Partitioning and pivoting

c)

Comparing and shifting into the sorted part

d)

Binary tree traversal

10.

Why might Bubble Sort be a poor choice for sorting large datasets?

a)

It uses too much memory

b)

It makes many unnecessary comparisons and swaps

c)

It requires multiple arrays

d)

It cannot handle strings

11.

What makes Insertion Sort more efficient for nearly sorted arrays than Bubble Sort?

a)

It skips unnecessary comparisons

b)

It only shifts elements instead of swapping many times

c)

It sorts from the middle

d)

It uses binary search to place elements

12.

What makes Insertion Sort more efficient for nearly sorted arrays than Bubble Sort?

a)

It skips unnecessary comparisons

b)

It only shifts elements instead of swapping many times

c)

It sorts from the middle

d)

It uses binary search to place elements

13.

Why is Heap Sort not stable even if it sorts correctly?

a)

It uses extra memory

b)

It fails to sort large numbers

c)

Equal elements may be reordered during heap operations

d)

It doesn't divide the array

14.

How does the number of swaps in Bubble Sort compare to Selection Sort?

a)

Bubble Sort performs more swaps due to repeated comparisons

b)

Selection Sort swaps on every comparison

c)

Both swap the same number of times

d)

Bubble Sort only swaps once per pass

15.

A student claims Insertion Sort is faster than Merge Sort. In which case might they be correct?

a)

When sorting large random datasets

b)

When working with external storage

c)

When the input list is almost sorted

d)

When the list has many duplicates

16.

Why is Merge Sort preferred over Quick Sort in real-time systems?

a)

It’s easier to code

b)

It guarantees consistent performance regardless of input

c)

It is faster in all cases

d)

It uses recursion efficiently

17.

How does Heap Sort ensure that the largest element reaches the correct position?

a)

By partitioning the array

b)

By building a max heap and extracting the root repeatedly

c)

By merging halves

d)

By selecting the minimum in each pass

18.

Which sorting algorithm would you choose for sorting a small array of 10 elements? Why?

a)

Merge Sort, for consistent speed

b)

Insertion Sort, for simplicity and low overhead

c)

Heap Sort, for maximum memory usage

d)

Quick Sort, for recursion depth

19.

Quick Sort performs poorly on a dataset, what could be the reason?

a)

The data is already sorted

b)

The algorithm is not coded properly

c)

Poor pivot selection leads to unbalanced partitions

d)

Too few comparisons are made

20.

What is the primary concept behind Merge Sort?

a)

Divide and Conquer

b)

Swapping

c)

Heapifying

d)

Partitioning

21.

Which sorting algorithm performs well for small datasets and is simple to implement?

a)

Merge Sort

b)

Quick Sort

c)

Insertion Sort

d)

Heap Sort

22.

____ ____ is the topmost node in a tree that has no parent.

(a)  

23.

____ ____ refers to nodes that do not have any children.

(a)  

24.

In a tree data structure, a node can have multiple parents.

a)

True

b)

False

25.

The root node is the topmost node in a tree and has no parent.

a)

True

b)

False

26.

Siblings in a tree are nodes that share the same parent.

a)

True

b)

False

27.

In a binary tree, each node can have a maximum of three child nodes.

a)

True

b)

False

28.

The height of the tree is the longest path from the root to a leaf node.

a)

True

b)

False

29.

The degree of a tree is the number of nodes in the entire tree.

a)

True

b)

False

30.

In an inorder traversal, the order is: Left → Root → Right.

a)

True

b)

False

31.

A leaf node is a node that has no child nodes.

a)

True

b)

False

32.

The Binary Search Tree allows duplicate values in both left and right subtrees.

a)

True

b)

False

33.

In a postorder traversal, the root is visited before any of its subtrees.

a)

True

b)

False

34.

A tree in which each node has at most two child nodes.

(a)  

35.

The total number of edges from the root node to a specific node.

(a)  

36.

The maximum number of children a node can have in the entire tree.

(a)  

37.

The node that comes before a given node in the tree structure.

(a)  

38.

A type of tree traversal where the node is visited after its left and right children.

(a)  

39.

A node and all its descendants considered as a small tree

(a)  

40.

List the order of Tree Traversal in "POSTORDER".

Note: Do not use commas or spaces. Just list the order.

(a)  

41.

List the order of Tree Traversal in "PREORDER".

Note: Do not use commas or spaces. Just list the order.

(a)  

42.

List the order of Tree Traversal "INORDER"

Note: Do not use commas or spaces. Just list the order.

(a)  

43.

What can you infer about a tree if every node has exactly two children except the leaves?

a)

It is a complete binary tree

b)

It is a full binary tree

c)

It is a ternary tree

d)

It is a degenerate tree

44.

Which situation would most likely cause a binary search tree to degenerate into a linked list?

a)

Inserting random values

b)

Inserting sorted values

c)

Inserting values in even/odd pattern

d)

Removing root repeatedly

45.

If you want to display data in a binary search tree from lowest to highest, which traversal would be best?

a)

Postorder

b)

Preorder

c)

Inorder

d)

D. Level order

46.

A student designed a tree where some nodes have five children. Which type of tree has this structure?

a)

Binary Tree

b)

Ternary Tree

c)

Generic (N-ary) Tree

d)

Balanced Tree

47.

What will happen if you try to insert a duplicate value into a standard Binary Search Tree?

a)

It goes to the right subtree

b)

It goes to the left subtree

c)

It will be rejected

d)

It replaces the existing value

48.

Which traversal would be most suitable to clone the structure of a tree from the top-down?

a)

Preorder

b)

Inorder

c)

Postorder

d)

Level order

49.

In designing a file directory system, which data structure would be best suited and why?

a)

Queue – because it's simple

b)

Array – for linear data

c)

Tree – for hierarchical organization

d)

Stack – for LIFO behavior

50.

If two sibling nodes have the same depth and different values, what can you deduce about their parent?

a)

It has one child

b)

It is a leaf node

c)

It must be one level above and has at least two children

d)

It is the root node

51.

You are designing a sorting algorithm using a BST. What is the best method to retrieve the sorted list?

a)

Traverse right subtree only

b)

Use BFS

c)

Inorder traversal

d)

Preorder traversal

52.

Which change would you make to a binary tree to reduce its height without losing nodes?

a)

Convert it to a degenerate tree

b)

Add more duplicate values

c)

Balance the tree

d)

Remove the leaf nodes

53.

Imagine a system for managing employee hierarchies. Which node type would best represent a manager with no subordinates?

a)

Root Node

b)

Internal Node

c)

Leaf Node

d)

Sibling Node

54.

You are creating a diagram of a university's course prerequisites using a tree. What does each edge most likely represent?

a)

A classroom

b)

A requirement

c)

A semester

d)

A student

55.

A programmer created a traversal to delete nodes from leaf to root. Which traversal did they most likely use?

a)

Preorder

b)

Inorder

c)

Postorder

d)

Level order

56.

What tree structure would be most suitable for multi-way decision-making, such as in a game AI?

a)

Binary Tree

b)

Ternary Tree

c)

N-ary Tree

d)

Balanced BST

57.

If you want to track family generations, how would you design the levels in the tree?

a)

Random order

b)

By age

c)

Root = eldest, Level increases by generation

d)

All on one level

58.

You are designing a file explorer. Why would a preorder traversal help generate the file structure view?

a)

It lists smallest files first

b)

It visits all files at the same level

c)

It displays directories before contents

d)

It sorts files alphabetically

59.

You want to model tournament brackets. Which node type would represent the final winner?

a)

Leaf

b)

Child

c)

Root

d)

Internal

60.

A BST is unbalanced with all nodes on the right. What data pattern most likely caused this?

a)

Random

b)

Decreasing

c)

Increasing

d)

Alternating

61.

If you want to prevent deep recursion in a tree operation, what structure would help the most?

a)

Linked list

b)

Balanced Tree

c)

Stack

d)

Heap

62.

You are tasked to build a classification system for animals based on their characteristics. Which tree concept applies best?

a)

Postorder deletion

b)

Tree traversal

c)

Hierarchical classification

d)

Hashing

63.

Which sorting algorithm is best suited for partially sorted datasets, offering fast performance with minimal changes?

a)

Bubble Sort

b)

Insertion Sort

c)

Merge Sort

d)

Selection Sort

64.

Which of the following is true when comparing Quick Sort and Merge Sort?

a)

Both use extra memory for merging

b)

Merge Sort is faster in practice

c)

Quick Sort is in-place and generally faster

d)

Quick Sort is stable by default

65.

A (a)   Tree allows up to three children per node.

66.

List the order of Tree Traversal "PREORDER"

Note: Do not use commas or spaces. Just list the order.

(a)  

67.

List the order of Tree Traversal "INORDER"

Note: Do not use commas or spaces. Just list the order.

(a)  

68.

It is the process of arranging data or elements in a specific order, such as ascending or descending, to make searching and organizing more efficient.

(a)  

69.

(a)   this process until a pass completes with no exchanges.

70.

What sorting algorithms says "Everything smaller goes to the left, bigger goes to the right"?

(a)  

71.

A sorting algorithm partitions the array and then recursively sorts each part. This approach is most likely used by:

a)

Merge Sort

b)

Selection Sort

c)

Quick Sort

d)

Bubble Sort

72.

What sorting algorithm uses a binary data structure?

(a)  

73.

This simple sorting technique repeatedly finds the minimum value from the unsorted portion of the array and moves it to its correct position by exchanging it with the current index.

(a)  

74.

A node with the maximum number of children in a tree determines the (a)   of that tree.

75.

The connection between any two nodes in a tree is called a/an (a)   .

76.

List the order of Tree Traversal "POSTORDER"

Note: Do not use commas or spaces. Just list the order.

(a)