wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

reviewer

Total questions: 27

Worksheet time: 14mins

Name
Class
Date
1.

Which of the following is true about a Binary Search Tree (BST)?

a)
A BST allows duplicate values in both subtrees of a node.
b)
In a BST, all values are randomly distributed without any order.
c)
In a BST, for any node, all values in the left subtree are less than the node's value and all values in the right subtree are greater.
d)
In a BST, the left subtree always contains larger values than the node.
2.

This data structure is a specialized method to organize and store data in the computer to be used more effectively. It consists of a central node, structural nodes, and sub-nodes, which are connected via edges.

a)

Linked List

b)

Stacks

c)

Queues

d)

Trees

3.

What do you call the position of John in the image?

a)

Topmost

b)

Root

c)

Child

d)

Parent

4.

What do you call Steve and Rohan?

a)

Root

b)

Parent

c)

Descendant

d)

Leaf

5.

Which of the following is not a characteristic of a Tree?

a)

It has no loop and no circuit

b)

We can access both ends.

c)

It has no self-loop 

d)

Its hierarchical model

6.

This is defined as the length of the path from the root to that node.

a)

Edge

b)

Height

c)

Depth

d)

Degree

7.

A type of tree which can only have a maximum of two child nodes.

a)

Binary Tree

b)

General Tree

c)

Balanced Tree

d)

Binary Search Tree

8.

It is a type of tree data structure that helps in maintaining a sorted stream of data.  

a)

Spanning trees

b)

Binary Search Tree

c)

Syntax tree

d)

Heap

9.

It is the shortest path tree used in the routers to direct the packets to the destination.  

a)

Spanning trees

b)

Binary Search Tree

c)

Storing hierarchical data

d)

Syntax tree

10.

A node that has no child is known as the ______

a)

Root

b)

Edge

c)

Leaf

d)

Subtree

11.

The tree considering that particular node as the root node.

a)

Subnext Tree

b)

Subtree

c)

Root

d)

Edge

12.

What is the primary function of a bubble sort algorithm?

a)

To reduce the size of a data set

b)

To merge two sorted lists into one

c)

To find the maximum value in a list

d)

To order an unordered list of items by comparing and swapping them if necessary

13.

Which of the following best describes the efficiency of the bubble sort algorithm?

a)

Least efficient sorting algorithm

b)

Efficient for data sets that are already partially sorted

c)

Efficient only for large data sets

d)

Most efficient sorting algorithm

14.

What condition must be met for the bubble sort's main while loop to continue executing?

a)

The list is empty

b)

All items are already sorted

c)

At least one swap has occurred

d)

No swaps are needed

15.

In bubble sort, what happens when two items are out of order?

a)

They are left as is

b)

They are immediately moved to the correct position

c)

They are swapped

d)

A new list is created

16.

What is the purpose of the 'swapped' boolean variable in the bubble sort algorithm?

a)

To track the number of iterations

b)

To count the number of swaps

c)

To indicate whether a swap has occurred

d)

To stop the algorithm

17.

How does the bubble sort algorithm determine when the sorting process is complete?

a)

When the list has been iterated through once

b)

When the list is in ascending order

c)

When no more swaps can be made

d)

When all elements are equal

18.

What is the initial setting of the 'swapped' variable at the start of the bubble sort algorithm?

a)

Undefined

b)

Null

c)

True

d)

False

19.

Which of the following is NOT a step in the bubble sort algorithm?

a)

Swapping items if they are out of order

b)

Repeating the process until no swaps are needed

c)

Comparing each item with the next one

d)

Selecting the smallest item and moving it to the start

20.

What does the bubble sort algorithm do each time through the while loop?

a)

Leaves 'n' unchanged

b)

Decreases the value of 'n' by one

c)

Increases the value of 'n' by one

d)

Resets 'n' to the length of the list

21.

Which of the following is a correct statement about the bubble sort algorithm?

a)

It is ideal for very large data sets due to its efficiency

b)

It is often used because it is easy to implement and understand

c)

It does not require any comparisons between list items

d)

It sorts items in random order to increase unpredictability

22.

We are sorting the following list in ascending order:


5 4 2 9 3 1 8


What does the list look like after ONE pass of the selection sort algorithm?

a)

1 2 4 3 8 5 9

b)

1 4 2 9 3 5 8

c)

1 5 4 2 9 3 8

d)

4 5 2 9 3 1 8

23.

Selection Sort puts all of the items in an array in:

a)

ascending order only

b)

descending order only

c)

ascending or descending order

d)

neither ascending or descending order

24.

The Selection Sort algorithm repeatedly finds the smallest value in the list, then swaps it into its sorted position.

a)

True

b)

False

25.

Why might a sorting algorithm be needed before a search?

a)

Data is less when sorted

b)

Data cannot be searched if it not sorted

c)

Data can be retrieved faster and easier when sorted

d)

Data must always be sorted before it is searched

26.

We are sorting the list in descending order:


Stacy Mark Arnold Betty Tom


What does the list look like after ONE pass of the selection sort?

a)

Stacy Mark Arnold Betty Tom

b)

Arnold Stacy Mark Betty Tom

c)

Arnold Betty Stacy Mark Tom

d)

Tom Stacy Mark Betty Arnold

27.

What does a sorting algorithm do?

a)

Finds an item of data in a list

b)

Puts a list of items into order

c)

Saves a set of data

d)

Separates a list of data