Understanding algorithms is essential if you are looking for a data science (or any other software development) career. In fact, a thorough understanding of algorithms is one of the most sought after skills you can have in 2021. They are the core of effective development and are a part of the day-to-day work done by developers.
An algorithm is a finite set of well-defined instructions that is used to solve a specific problem or to calculate something. You don’t need to be a mathematical genius to understand algorithms; you essentially just need to be able to break a problem down into bite sized chunks and then define a set of processes that, when followed, will build a solution to the problem.
1. Make sure you have a firm grip on the basics
A basic understanding of Data Structures, Logic, and Computer Architecture is essential to understanding algorithms. You can learn these in a computer science course, on a coding boot camp, by reading books, watching videos, or attending lectures online.
Here is a list of 10 excellent online courses that are free.
- CS50’s Introduction to Computer Science – Harvard University
- Introduction to Computer Science and Programming – MIT
- Computer Science 101 – Stanford University
- Computer Science: Programming with a Purpose – Princeton University
- Accelerated Computer Science Fundamentals Specialization – University of Illinois at Urbana-Champaign
- Intro to Theoretical Computer Science – Udacity
- Mathematical Thinking in Computer Science – University of California San Diego
- Computer Science 101: Master the Theory Behind Programming – Skillshare
- Foundations of Computer Science: Theory and Practice – SE Factory
- CS50’s Computer Science For Business Professionals – Harvard University
2. Improve your logical thinking skills
Algorithms are much easier to understand if you have well-honed logical thinking skills. Logical thinking enables you to look at a problem that needs to be solved or a task that needs to be completed and come up with a sensible step-by-step solution to solve the problem or complete the task. As your brain is a muscle you can easily exercise it and improve your logical thinking skills.
Exercise your brain daily by doing puzzles or playing games. Winning a game of Chess, completing a Rubik’s cube, or solving a Sudoku puzzle, all require you to work a problem backwards instead of forwards, and will do wonders for your problem solving skills.
There are several websites and apps that offer “brain training”. They will not only develop your logical thinking skills but also improve your memory and overall mental fitness. Lumosity, Elevate, Peak, Happy Neuron, and Braingle all offer a myriad of different games that will help improve your mental agility.
You can also consciously approach things you do every day as if they’re algorithms. Define what needs to be done, plan the steps needed, and use if-then statements to achieve them.
3. Master Mind Maps
Generally, when we’re confronted with a problem that needs solving, we automatically panic. Mind Maps are very useful tools that calm the brain down because they help you focus by opening up possibilities, giving you clarity, and helping you find answers more easily.
Mind maps put all the facets of a problem into a single snap shot which helps you focus and prioritize. They employ radial thinking which stimulates your brain to generate ideas through associations which will open up a range of solutions.
Try making 2 mind maps, one for the problem and one for the solution. Place the problem in the centre of the first mind map and add branches with all the causes and aspects of the problem. Use sub-branches to add more detail. Then make your second mind-map with ‘Solutions’ at the centre. Add branches for each of the paths you could take to solve the problem with sub-branches to add more detail. The best solution for solving your problem will become clear.
4. Study well-known algorithms
Spending time studying existing algorithms that are the foundation of fundamental programming concepts will help you better understand algorithms as a whole. For example, by looking into the details of search and sort algorithms you will understand what steps are in the process and why.
Studying search and sort algorithms will provide you with a sound understanding of how algorithms are created, how efficient they are, how they can be improved, and how to choose between different algorithms. Searching and sorting are activities that usually build on each other and, as such, are good examples of how algorithms impact on the real-world and how more complex but efficient algorithms are developed.
If you’re familiar with the following search and sort algorithms you will be well on your way to understanding algorithms.
- Linear search
- Binary search
- Insertion sort
- Bubble sort
- Selection sort
- Merge sort
5. Practice, practice, practice
The best way to consolidate your understanding of algorithms is the same as any other skill, practice as much as you can. Unlike physical skills such as throwing a ball or driving a car, doing the same thing over and over again is not going to help you very much. Trying to do the same thing differently is key to understanding algorithms.
There are many different algorithms that can solve the same problem. The skill lies in finding the most efficient way to solve the problem by coming up with new algorithms and being able to implement them and evaluate them. In order to evaluate the efficiency of your implementation you can time your solution and compare it to the existing ones; get an experienced developer to look at your algorithm, or practice on a code challenge website.
Here are four code challenge sites you can try out:
Get started with these 5 ways to improve your understanding of algorithms and you will have a firm grasp of the basics needed to pursue your career in data science.