You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This is just a demonstration of the implementation of some sorting algorithms using Python. There are implementations ofsorting in Python's standard library that are much better for performance reasons.When I wrote these codes I was learning Python and I wanted to do some exercises to improve my Python skills and thensince I was taking Data Structures classes in college I implemented the algorithms in Python, I already knew the mostwell-known sort algorithms, but I ended up getting myself excited and learning a few more as was the case with Comb,Gnome Cocktail and Shell Sort.
The following algorithms were implemented:
Bubble
Bucket
Cocktail
Comb
Counting
Gnome
Heap
Insertion
Selection
Merge
Quick
Radix
Shell
The program shows the execution times of each algorithm, it is possible to create a random vector of integers and testit with all the algorithms for comparison purposes. It is nice to note that the difference in execution times of eachalgorithm grows as you use larger vectors. Small vectors are ordered quickly by any of these algorithms with a smalltime difference between them, but by increasing the vector sizes, it is seen that the more advanced algorithms likeQuick, Merge, Bucket, Heap and Shell go absurdly better than the others.