posted 8 years ago
Hello there!
Am having a little trouble understanding selection sort want to make sure I am following correctly.
Found the code, just trying to conceptualize it, so imagining we pass in an array such as: 9,5,2,7,1
And then we carry on to iteration 2, then 3 then 4 each time doing a inner for-loop to find the proceeding smallest value ahead of its index.
A major thing I don't get is how is this updating a list? like how is it being saved to eventually return a sorted list?
please tell me if I am misunderstanding anything
Thank you