Last active
December 28, 2015 17:43
-
-
Save aa-ahmed-aa/e18e24af13a89eb1fbe2 to your computer and use it in GitHub Desktop.
This file contains 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
//loop from the (begining) to the (size-1) index = c | |
{ | |
//save the current index in position | |
//search for the greater element loop from (begining+1) to (size) index = d | |
{ | |
//look for smaller element | |
//if the current element[d] is less than the element[position] | |
//change the saved index with the smaller element index (d) | |
} | |
//if the position has been changed | |
//swap the element of index position with the element of index c smaller with greater | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment