Implement a algorithm, or create a algorithm that is able to sort a array (smallest to largest).

[3, 2, 1] -> [1, 2, 3]  
[5, 7, 6] -> [5, 6, 7]