Days 84 - 112

Project Algorithms and Data Structures

Learning the fundamentals of sorting and path finding algorithms

 

Because of the app SoloLearn I was introduced to some sorting algorithms like bubble sort or shell sort but I never really dived into this topic.

  1. What is an algorithm
  2. Learning fundamental sorting algorithms like Quick, Heap, Merge, Insertion, Selection, Radix Sort
  3. Getting to know path finding algorithms like Depth First Search, Breadth First Search or Dijkstra's algorithm + how to traverse a binary tree
  4. Practise by solving classic CS problems
  5. Getting familiar with time, space complexity + Big O notations

What is an algorithm? And what does a cooking recipe has to to with an algorithm?

A cooking recipe is also just a series of steps to achieve a logical result, which is to bake the exact cake with as few steps as possible. Imagine if someone wrote something like “… and then add 250 grams of flour…. no, wait, it’s actually 100 grams… never mind, put in as much flour as you need until the dough looks good…”. You would be confused and as a result, this algorithm of yours would go horribly wrong when baking a cake.
Before diving into various sorting algorithms, it occurred to me that search algorithms are also an important topic to cover.

Learning Sorting algorithms with python

In the next steps I would go along learn about different sorting algorithms and code them with the programming language python. 
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Insertion Sort
  • Radix Sort
  • Selection Sort

Getting to know path finding algorithms

The three main path finding algorithms that nearly every thread on the web recommended were Depth First Search, Breadth First Search and Dijkstra’s algorithm. There are two major things that you have to consider here. 
  1. Does the algorithm really shows you the shortest path?
  2. Is the algorithm weighted, meaning is there a numerical number attributed to the edges of the graph?
Underneath each algorithm you can find the according animation how this algorithm looks like when put into a maze to search for a goal. (The third animation shows the difference between all of them, keep in mind that Dikstra is weighted)
You want to create your own maze and test out different path finding algorithms? Click here

Time and Space complexity

Evaluating the performance of a given algorithm is crucial when it comes to writing a good algorithm. The main question you ask here is: “How does the time and capacity of the working memory (RAM) grow when the input size grows towards infinity?”

Practise: Solving classic computer science problems

These problems are often asked in job interviews when you want to apply for a programming job. Unfortunately, these problems have nothing to do with the actual work you will be doing later, because no one is asking you to write a sorting algorithm from scratch. People use precoded modules for these tasks in order to focus on the actual work. 

Solving a real, non-textbook problem

Problems that you can find in most computer science textbooks are pretty straight forward with an easy to understand goal. But what about more abstract real life situations? For instance it’s your task to boost a performance of a system. 
For these non-textbook problems I challenged myself to write a Discord bot that would interact with a user to perform tasks. In this case outputting a simple inspirational quote.

Important Data structures

I never seen two pretty best friends but if I have to choose one pair it would be algorithms and data structures.
Simply put, data structures are just different ways to store your data. Whether you store the data in a hierarchy (e.g. in a min-max heap) or with a key + value pair (Hash table), the main task remains the same… storing data. 
Progress
Smaller steps towards the goal 100%

Personal comment on the project "Algorithms"

Problem solving is the backbone of computer science, and algorithms are just step-by-step instructions on how to solve them using a language that a computer can understand. So knowing how an algorithm works is critical if you want to understand more sophisticated algorithms like machine learning algorithms. 
What’s kind of frustrating is that you usually don’t need to know how to program a sorting algorithm like Quick Sort from scratch because they either come in packaged modules that you can install, or you can find the code on stackoverflow.com But getting comfortable with a real programming environment wasn’t my goal. My primary goal was to understand the code and evaluate its performance.
At the end I must say learning about fundamental algorithms has helped me immensely to think in a more structured way when approaching logical problems which I’m quite thankful for.

Click the arrow to go back to the top