Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Selectionsort
Implementation happens on the following initial description:
We pick up the first element and assume it is the smallest in the array. After that we iterate trough the array searching for the real smallest element. If we find one, we switch our current with the found one and continue with the next element.
🤔 Thoughts
This is basicly the reverse of the Insertionsort. The easiest way to compare the two is to imagine a hand full of playing cards that should be sorted.
Insertion
We let the first card be and go to the second one. Pick it up and compare it the cards to the left and keep moving left until the card we are holding is bigger then the card to the left and drop it there. To back to our starting point and repeat the process until the last card was picked up and droped.
Selectionsort
We look at our first card and go trough all cards to the right. On the way we mark the lowest card we found. After we went all the way back to the right, we remember the marked card and switch it with the first one and repeat the process with the second card and so on until we reach the last card on the right.