Commit Graph

13 Commits

Author SHA1 Message Date
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
Ashwek Swamy
e8754a1a5e
Merge pull request #103 from mrdogan7/patch-1
n is now taken as an input.
2019-02-09 12:59:16 +05:30
William Grigor
672f9dc57f Bubble Sort now uses vectors 2018-12-21 23:01:52 -06:00
Vaibhav Gupta
485d1b2bb8
solve bus-error (core dumped), run-time error
- Run time error on linux.
  - 'n' is declared but not initialized, neither its value is taken from user.
  - 'n' contains garbage value, thus throws run time error.
2018-10-02 17:05:25 +05:30
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
Emre Doğan
4ff86897b1
n is now taken as an input. 2018-09-26 00:19:09 +03:00
Naveen Hegde
d4c358f369
Added Cocktail Selection Sort
Cocktail Selection Sort is a Sorting algorithm which chooses the minimum and maximum element in an array simultaneously, and swaps it with the lowest and highest available position iteratively or recursively
2017-12-30 02:10:22 +05:30
Naveen Hegde
e1879d3432
Added SlowSort
added the main function as requested.
added only the necessary header as requested.
Description of Slow Sort can be found here https://en.wikipedia.org/wiki/Slowsort
2017-12-25 23:38:23 +05:30
sandeeproy99
8b6530526a
Tim Sort.cpp
Tim Sort Algorithm is based on radix sort & bubble sort.

It's stable algorithm which works in O(n Log n) time, is used in Java's Array.sort(). It first sorts using small pieces, later sorts each with merge sort.
2017-10-28 16:26:02 +05:30
Sayantika Banik
4d8185f83e bucket sort code added 2017-09-29 07:55:30 +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