This algorithm will sort numbers from least to greatest. \n\nStep 1: Begin with an array of unsorted numbers. \nStep 2: Set two variables; "min" and "index". \nStep 3: Iterate through the array. \nStep 4: Compare each value with "min". \nStep 5: If the value is less than "min", update min and record the index of the value. \nStep 6: After each iteration, swap the value at the index of "min" with the value at the beginning of the array. \nStep 7: The beginning of the array is now the smallest value. \nStep 8: Repeat steps 3-7 for the remaining elements until everything is in order.
Write an algorithm to sort numbers from least to greatest?