Computer Science is often regarded as over-complicated and difficult to learn. However, the logic that governs most computer languages, and software is in fact rudimentary. Algorithms are essential in any computer process; reducing the complexity of the problems. They are the driving force behind automation and are the building blocks of many useful tools and processes that we see in our everyday life from road navigation to forecasting weather.
A Sorting Algorithm is a technique that a computer uses to sort large sets of data in order in the most time and memory efficient manner possible. There are many different kinds of sorting algorithms, each having its pros and cons. Step into the world of algorithms, become a computer and sort these numbers in order using 4 different algorithms used by computers everyday, after which you'll definitely be more appreciative of how computers sort these numbers in fractions of a second.
Through Potato Pirates: Algospuds you'll be mastering the sorting algorithms which power all the software you use - from sort your Excel data in alphabetical order, to sorting your amazon Amazon searches by price, to sorting your Spotify playlist by popularity. Have a blast playing Potato Pirates: Algospuds all while picking up very important and fundamental concepts in computer science.
Play to learn, learn to play. Go forth and sort!
Watch the tutorial and download this free activity to get you started
Put your skills to your test with these 4 sorting challenges
Learn how these algorithms work as you perform these challenges
Tag us on Social Media Platforms to let us know how you fare!
A Divide and Conquer algorithm that picks an element in the data structure as a pivot point and creates partitions around the picked pivot. This process is repeated, thereby creating a tree, until the algorithm reaches a base case with just one element in the sub-list. The tree is then reassembled into the original data structure - this time sorted.
This algorithm scans an entire data structure, one element at a time to find the smallest value and places that element in the left-most position which is unsorted. It repeats this process until the entire data structure is sorted.
Starting from the left-most position, this algorithm checks two adjacent elements and swaps their positions if they are in the wrong order i.e. the right value is smaller than the left. This process is repeatedy until it reaches the end of the data structure, causing the larger values to 'bubble' to the right. Hence, the name. The process then starts from the left again until no more swaps are required to be made, at which point, the data is said to be sorted.
This algorithm starts from the left-most position, compares each element with all the elements to its left, finds the correct location of the element and places it there. All the elements to the left of the current position (or index) of the algorithm are always sorted. If the current index has a value larger than everything to its left, it is not moved. The algorithm instead, moves on to the next index.