NEW
Font size
Worksheetsreviewer
Total questions: 27
Worksheet time: 14mins
Which of the following is true about a Binary Search Tree (BST)?
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.
Linked List
Stacks
Queues
Trees
What do you call the position of John in the image?
Topmost
Root
Child
Parent
What do you call Steve and Rohan?
Root
Parent
Descendant
Leaf
Which of the following is not a characteristic of a Tree?
It has no loop and no circuit
We can access both ends.
It has no self-loop
Its hierarchical model
This is defined as the length of the path from the root to that node.
Edge
Height
Depth
Degree
A type of tree which can only have a maximum of two child nodes.
Binary Tree
General Tree
Balanced Tree
Binary Search Tree
It is a type of tree data structure that helps in maintaining a sorted stream of data.
Spanning trees
Binary Search Tree
Syntax tree
Heap
It is the shortest path tree used in the routers to direct the packets to the destination.
Spanning trees
Binary Search Tree
Storing hierarchical data
Syntax tree
A node that has no child is known as the ______
Root
Edge
Leaf
Subtree
The tree considering that particular node as the root node.
Subnext Tree
Subtree
Root
Edge
What is the primary function of a bubble sort algorithm?
To reduce the size of a data set
To merge two sorted lists into one
To find the maximum value in a list
To order an unordered list of items by comparing and swapping them if necessary
Which of the following best describes the efficiency of the bubble sort algorithm?
Least efficient sorting algorithm
Efficient for data sets that are already partially sorted
Efficient only for large data sets
Most efficient sorting algorithm
What condition must be met for the bubble sort's main while loop to continue executing?
The list is empty
All items are already sorted
At least one swap has occurred
No swaps are needed
In bubble sort, what happens when two items are out of order?
They are left as is
They are immediately moved to the correct position
They are swapped
A new list is created
What is the purpose of the 'swapped' boolean variable in the bubble sort algorithm?
To track the number of iterations
To count the number of swaps
To indicate whether a swap has occurred
To stop the algorithm
How does the bubble sort algorithm determine when the sorting process is complete?
When the list has been iterated through once
When the list is in ascending order
When no more swaps can be made
When all elements are equal
What is the initial setting of the 'swapped' variable at the start of the bubble sort algorithm?
Undefined
Null
True
False
Which of the following is NOT a step in the bubble sort algorithm?
Swapping items if they are out of order
Repeating the process until no swaps are needed
Comparing each item with the next one
Selecting the smallest item and moving it to the start
What does the bubble sort algorithm do each time through the while loop?
Leaves 'n' unchanged
Decreases the value of 'n' by one
Increases the value of 'n' by one
Resets 'n' to the length of the list
Which of the following is a correct statement about the bubble sort algorithm?
It is ideal for very large data sets due to its efficiency
It is often used because it is easy to implement and understand
It does not require any comparisons between list items
It sorts items in random order to increase unpredictability
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?
1 2 4 3 8 5 9
1 4 2 9 3 5 8
1 5 4 2 9 3 8
4 5 2 9 3 1 8
Selection Sort puts all of the items in an array in:
ascending order only
descending order only
ascending or descending order
neither ascending or descending order
The Selection Sort algorithm repeatedly finds the smallest value in the list, then swaps it into its sorted position.
True
False
Why might a sorting algorithm be needed before a search?
Data is less when sorted
Data cannot be searched if it not sorted
Data can be retrieved faster and easier when sorted
Data must always be sorted before it is searched
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?
Stacy Mark Arnold Betty Tom
Arnold Stacy Mark Betty Tom
Arnold Betty Stacy Mark Tom
Tom Stacy Mark Betty Arnold
What does a sorting algorithm do?
Finds an item of data in a list
Puts a list of items into order
Saves a set of data
Separates a list of data
