Files
C-Plus-Plus/Sorting
Vaibhav Gupta f499342869 Optimize bubble sort algorithm
-introduced variable 'swap' for 'outer-for-loop' of bubble sort algorithm. If it remains zero after executing inner-loop, it means array is sorted, hence it does not need to run for n^2 times.
- 'for(int j=0; j<n-1-i; j++)', as after each step, one number reaches to its right position. Thus inner loop does not need to run for 'n' times in every cycle.
2018-10-02 16:34:16 +05:30
..
2018-10-02 16:34:16 +05:30
2017-09-29 07:55:30 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-02-20 09:08:44 +05:30
2017-12-25 23:38:23 +05:30
2017-10-28 16:26:02 +05:30