user
Write an algorithm for sorting numbers in an array.

assistant
Algorithm for sorting numbers in an array: 
1. Set a marker at the beginning of the array. 
2. Compare the value of the number at the marker with the value of the number at the next position. 
3. If the number at the next position is less than the number at the marker, swap the two numbers. 
4. Move the marker position one step forward and repeat step 2-3 until the end of the array is reached. 
5. When the end of the array is reached, start again at the beginning and repeat step 2-3 until no swaps are made. 
6. The array is now sorted.