Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, the
y should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?
If the first number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.
If the first number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.
A
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them.
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them.
B
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the last number, swap them.
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the last number, swap them.
C
If the first number is greater than the middle number, swap them. Then, if the middle number is greater than the last number, swap them. Then, if the first number is greater than the middle number, swap them.