About Bubble Sort, bubble sort's working principle, algorithm analysis, best-worst case, such as information has been added. A person entering this pull request can easily learn about bubble sort.
In addition, information about the swap process used in the algorithm is also included in the code how to work. To make this process is fully explained in the lower example is explained in the sample. In some places, design changes were made to make it look pleasing to the eye.
Bubble Sort(Kabarcık Sıralama) hakkkında bubble sort'un çalışma prensibi,algoritma analizi,en iyi-en kötü durum gibi bilgiler eklenmiştir.Bu pull request'e giren bir kişi bubble sort hakkında kolayca bilgi edinebilir.
Ayrıca algoritmada kullanılan swap işlemi hakkında da kod içinde nasıl çalıştığı bilgisi eklenmiştir.Bu işlemi tam anlaşılır hale getirmek içinde alt kısımda örnekle açıklanmıştır.Kod içinde de bazı yerlerde göze hoş gözükmesi için dizayn değişiklikleri yapıldı.
- 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.
-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.
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
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
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.