Team Astro Presents: Sorting Algorithms
Learn Common Programming Principle Sorting Algorithms
Learn Common Programming Principle Sorting Algorithms
Everything you need to know about sorting algorithms
Sorting algorithms are the logic that takes an unsorted list of things and converts that list to a sorted list.
The logic that we use to sort is what we call the algorithm. There are plenty of algorithms we use in today's world that help us solve all sorts of different problems.
They can be tricky to understand at first, but if you peer into your own life you will realize your brain is utilizing sorting logic everyday! Think about the last time you were in the library looking for a specific author? Did you start with the first book in the library, then the second, and then the third all the way until you found the Author? Or maybe you looked at the middle of the library to see what letter the authors names started with and then moved left or right depending on your find. These are both examples of sorting algorithms!
Big O notation is the way in which we talk about how fast a sorting algorithm is.
You may think at first, "Why don't we just measure how long it takes to sort a a set of things?" We could, but the problem is that lists vary in sizes, and instead of talking about the measurable time, we like to talk about how the speed of an algorithm changes as the list of things gets bigger and bigger!
Big O notation is often noted like this: O(n), O(n2), O(nlog(n)), O(log(n)), O(1)