Use the insertion sort algorithm to arrange these numbers in ascending order, writing the result of each step of the insertion sort.
8, \quad 3, \quad 2, \quad 1, \quad 5, \quad 4
For each of the following data sets:
Use the insertion sort algorithm to arrange these numbers in ascending order, writing the result of each step of the insertion sort.
Hence find the median of the data set.
72, 26, 63, 48, 31, 55, 17
864, 332, 225, 777, 626, 168, 493, 533
Consider the following set of data:
5, \, 7, \, 9, \, 4, \, 3, \, 6, \, 4, \, 1, \, 2, \, 3, \, 6, \, 7, \, 8, \, 9, \, 5, \, 2, \, 1, \, 5
Sort the numbers into the buckets below.
\text{Bucket} | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ||
⬚ |
Arrange the data set in ascending order.
Hence find the median of the data set.
Consider the following set of data:
9415, \quad 95, \quad 9, \quad 690, \quad 189, \quad 5, \quad 3002, \quad 83, \quad 583, \quad 3, \\ 5667, \quad 46, \quad 2, \quad 2669, \quad 74, \quad 492, \quad 419, \quad 13, \quad 6, \quad 6167
Sort the numbers into the buckets below based on the number of digits they have.
\text{Bucket} | 1 \text{ digit} | 2 \text{ digit} | 3 \text{ digit} | 4 \text{ digit} |
---|---|---|---|---|
⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ |
Arrange the values in each bucket in increasing order:
1 digit numbers.
2-digit numbers.
3-digit numbers.
4-digit numbers.
Arrange the data set in ascending order.
Hence find the median of the data set.
Consider the following set of data:
81, \quad 31, \quad 12, \quad 94, \quad 65, \quad 28, \quad 47, \quad 54, \quad 76, \\ 93, \quad 71, \quad 11, \quad 35, \quad 27, \quad 85, \quad 42, \quad 66, \quad 56
Sort the numbers into the buckets below based on their tens digit.
\text{Bucket} | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ |
Sort the numbers in each bucket in ascending order from top to bottom.
\text{Bucket} | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | |
⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ | ⬚ |
Arrange the data set in ascending order.
Hence find the median of the data set.
Consider the following set of data:
94, \quad 87, \quad 69, \quad 53, \quad 38
Use the bubble sort algorithm to arrange these numbers in ascending order. Write the result of each step of the bubble sort.
Hence find the median of the data set.
Consider the following set of data:
755, \quad 76, \quad 188, \quad 23, \quad 340, \quad 235, \quad 16, \quad 82
Use the merge sort algorithm to arrange these numbers in ascending order. Write the result of each step of the merge sort.
Hence find the median of the data set.
Consider the follwoing set of data:
78, \quad 12, \quad 6, \quad 63, \quad 24, \quad 49, \quad 9, \quad 5
Use the merge sort algorithm to arrange these numbers in ascending order, writing the result of each step of the merge sort.
Hence find the median of the data set.
When graphics programmers want to create a frame in their game, they need to make sure the colours of objects in the frame don't blend in to each other. They input the desired distance of each object from the camera, and the computer then sorts the objects in order from the closest to the furthest from the camera.
Six objects in a particular frame are the following distances from the camera:
8, \quad 4, \quad 3, \quad 1, \quad 6, \quad 5
Using the insertion sort algorithm, write each step that the computer would produce to put these numbers in ascending order.
A graphics programmer coded in the distances of the following objects from the camera:
Object | \text{Ocean} | \text{Bridge} | \text{Knight} | \text{Helmet} | \text{Boat} | \text{Tower} |
---|---|---|---|---|---|---|
Distance | 8 | 4 | 3 | 1 | 6 | 5 |
For this particular frame, which object will appear third closest to the player on the screen?
In a game of cards where each player is initially given 6 cards, Oprah is given her cards in the order shown:
To make it easier for her to see her highest valued cards, she uses bubble sort to order the cards so they are in increasing order. Picture cards are of highest value.
Following the bubble sort algorithm, on which numbered swap will Oprah need to swap the 2 of clubs with the 5 of spades?
State two cards that she will never need to swap.