Less Time Complexity

After Each for loop, the max element was sent the last index of the Array. You dont have to go to the until last index of the arr every loop. This will be helpful for your Algrotihm.
Merge pull request #1 from bilalarslan1993/patch-1

Less Time Complexity