Saturday, October 4, 2014

ACM 1100. Final Standings / Таблица результатов

The bubble sort works this way, if the current number which we are considering is smaller than the next one than we swap the places of those 2. We can look at this from another side, If we have a number which "is not in his position" then we should move it up until he meets someone which is more or equal than the current number. We can conclude that the order of the equal numbers will be the same after sorting. We should notice that the number which needs to be sorted can be from 0 to 100 which means that we can check for every number individually starting from 100 and output the corresponding number in the given order in the input/


       FULL SOURCE CODE

No comments:

Post a Comment