extend insertionsort#5
Merged
Merged
Conversation
added 19 commits
October 18, 2023 23:07
|
Kudos, SonarCloud Quality Gate passed! |
added 3 commits
November 21, 2024 10:16
# Conflicts: # .github/workflows/test.yml
|
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.











This RP extends the class
InsertionSort, which was renamed in the same place.The new sorting algorithm was implemented with the same technique als already used in Bubblesort to have a single
sortmethod which accepts a parameter to decide which variant to use and having variant1 as a default.The new algorithm
The new Approach of the sorting algorithm starts at the beginning and loops over the whole array, starting from the outer loops current postion, to find the smallest numer. The found number gets safed and replaced when needed. After the inner loop has ended, the so found number can switch places with the current outer index and the process repeats itself, now with one element less to sort.