Commit Graph

8 Commits

Author SHA1 Message Date
PRITI1999
c05fe43168
Update Bubble Sort.cpp
Removed unnecessary usage of break and restored the single entry and single exit mechanism
2019-09-17 21:49:29 +05:30
yanglbme
69ddc9fc52 style: format code 2019-08-21 10:10:08 +08:00
Ashwek Swamy
e18fe9f740
Update Bubble Sort.cpp 2019-02-09 13:25:57 +05:30
Ashwek Swamy
31abf60bc6
Merge branch 'master' into master 2019-02-09 13:25:12 +05:30
William Grigor
672f9dc57f Bubble Sort now uses vectors 2018-12-21 23:01:52 -06:00
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
Shivam Singhal
2a0c019573 Your branch is up-to-date with 'origin/master'. 2017-05-27 18:10:04 +05:30
AnupKumarPanwar
1c1746bc64 Sorting 2017-02-20 09:08:44 +05:30