Coding Sorting Algorithms in Python
What it does
It's an implementation of 3 different sorting algorithms in Python:
- Bubble sort
- Selection sort
- Insertion sort
It also shows how long each method takes (thanks to https://stackoverflow.com/questions/5478351/python-time-measure-function), and also compares it to python's in-built
sorted()function for fun!
Created during Kunal's Write Code to Sort a List workshop.
Challenges we ran into
- Python passes copies of arrays to functions instead of a reference to the same array, so I had to copy and return the modified arrays.
- Getting the indexes for the for loops right
What I learned
- How different sorting methods work
- What the efficiency of different sorting methods is
- About 'big O' notation, and time complexity
- Which methods are used in the real world
What's next?
- Research and implement more sorting algorithms
- Set up a way of generating random lists and testing all the sorting algorithms
- Program the algorithms in other programming languages (e.g. Ruby)
Log in or sign up for Devpost to join the conversation.