8 Sorting Algorithms explained
Sorting algorithms allow people to navigate, learn from and use large structured and unstructured data sets in their business and daily lives. All types of businesses need some way to keep track of data and make it sort-able and easy to understand. Ever wonder how some sites can remember your favorite things to buy and make recommendations what else you may like? Sorting algorithms! You guessed it.
There any may different ways to write algorithms to approach different situations and data with a different algorithm.
How to decide which to use?
To determine which algorithm is right for you, just ask Big Oh. This notation tells you the longest amount of time it will take to sort your data.
What is Big Oh again?
If you go through a list of n amount of items and order it in one single pass, that is O(n) because it took me the n amount of items to figure it out. But if I need to go through each item and compare them with each other item that is O(n^2), because I need to choose one by one each element and compare them to n other elements. To give you an idea say you have a set of numbers in front of you. If I told you to sort them from least to greatest you normally would find the smallest number and move it to the beginning and move on from there. That is a O(n^2) algorithm, because you choose one element and look through the whole list and find out where it belongs.
So there you have it. A brief description on 8 of the most popular sorting algorithms. Happy Sorting!
Credits to Rakiov https://imgur.com/gallery/kQe1v
Senior Software Engineer
8 年It's refreshing to see an article about a timeless computer science topic on LinkedIn.