Putting data into order can be difficult and time consuming. Sorting algorithms, such as bubble sort and bucket sort can help with this.
What does a sorting algorithm do?
Finds an item of data in a set of data
Saves a set of data
Puts a list of items into order
What does a bubble sort do?
Sorts a list by comparing two items that are side by side, to see which is out of order
Separates a list of data into different collections of data, before sorting and gathering back into a list
Finds an item of data in a list
How many passes will a bubble sort go through?
Only one pass
Several passes - until the data is fully ordered
Why does a bubble sort do a final pass even when the data is in the correct order?
To save the data
It does not recognise that the data is in order until the final pass requires no changes
It needs to do this to put the data back in to a list
Which of the following is an advantage of a bubble sort?
It is a very small and simple computer program
It takes a very long time to run
It is very quick
Which of the following is NOT an advantage of a bubble sort?
There is only one task to perform
What does a bucket sort do?
Separates a list of data into different collections of data which are sorted and gathered back into a list
Goes through a list of data a number of times and compares two items that are side by side to each other to see which is out of order
Which of the following is a disadvantage of a bucket sort?
It takes a long time to run
It is more complicated than a bubble sort
Which of the following is an advantage of a bucket sort?
It is quicker to run than a bubble sort
It is simpler than a bubble sort
Which of the following is not a type of sorting algorithm?