Improving your Algorithms & Data Structure skills
Tags: career, javascript, computerscience, challenge
Published: 2019-10-09 14:22:37

## Fundamentals

The first thing you’ll need if you want to get better at algorithms and data structures is a solid base. This base can be learned one of several ways, either through a computer science program at university, some coding bootcamps focus a bit on the topics below, or you can learn on your own from [books](https://www.quora.com/What-are-the-best-books-to-learn-algorithms-and-data-structures-Are-there-any-good-blogs-posts-on-these-Which-books-explain-these-concepts-in-a-simpler-way), videos, or [online lectures](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/). So you’ll need a basic understanding of the following topics to get started:

### Data Structures

Learn about arrays, linked lists, binary trees, hash tables, graphs, stacks, queues, heaps, and other fundamental data structures.

### Computer Architecture

Learn how data is represented in a computer, the basics of digital logic design, boolean algebra, computer arithmetic, floating-point representation, cache design. *Try and learn a little about C and Assembly programming.*

## Moving Forward Past the Fundamentals

Once you feel like you have a good understanding of most of the concepts listed above, it’s time to start diving into the algorithms part. Here is a list of resources and things I did to get better at writing and understanding important algorithms.

### Big-O & Runtime

* Learn what Big-O is and how to analyze the [running times](https://cs.stackexchange.com/questions/192/how-to-come-up-with-the-runtime-of-algorithms) of algorithms. This is a [classic book](https://en.wikipedia.org/wiki/Introduction_to_Algorithms) on the topic (here is the chapter on the [growth of functions](https://www.cs.dartmouth.edu/~ac/Teach/CS19-Winter06/SlidesAndNotes/CLRS-3.1.pdf)).

* Here is a good list of [online courses](https://github.com/tayllan/awesome-algorithms#online-courses) that teach algorithms.

### Implement Some Algorithms Yourself

Start off by implementing several important algorithms yourself and learning about their running times. Some examples are:

* Binary search
* Euclid’s algorithm
* Depth and breadth first search
* Dijkstra’s shortest path
* Binary tree traversals
* Insertion sort, Mergesort, Quicksort
* Min & max heaps
* More [examples](https://hbfs.wordpress.com/2008/12/23/the-10-classes-of-algorithms-every-programmer-must-know-about/) and [lists](https://softwareengineering.stackexchange.com/questions/155639/which-algorithms-data-structures-should-i-recognize-and-know-by-name).

### Algorithm Books

* Read the [Algorithm Design Manual](https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202). It’s a great book and it’s my favorite.
* [Introduction to Algorithms](https://en.wikipedia.org/wiki/Introduction_to_Algorithms) is a classic book that covers a lot of material.
* [Elements of Programming Interviews](https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1479274836) contains a lot of challenges and code solutions that will help you prepare for interviews.

### Challenges

* Practice coding simple and then more advanced algorithms on sites like [Coderbyte](https://coderbyte.com) which provide explanations and solutions so you can learn from other coders as well.
* Go through the challenges on this [interactive](https://runestone.academy/runestone/books/published/pythonds/index.html) python algorithms website.
* [The 10 most popular coding challenge websites for 2018](https://medium.com/coderbyte/the-10-best-coding-challenge-websites-for-2018-12b57645b654).
* [The 5 hardest code challenges for beginners.](https://medium.com/coderbyte/the-5-hardest-code-challenges-for-beginners-e410da4474b)

### Algorithms Explanations & Interview Questions

* Read as many algorithm explanations and code examples as you can on [GeeksforGeeks](https://www.geeksforgeeks.org/). Here is an [example](https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/) of a good post on graph algorithms.
* Look at some interview questions posted on [CareerCup](https://www.careercup.com/) and try and understand how other users solved the questions. Like this [example](https://www.careercup.com/question?id=5641027330244608).
* Aside from coding challenge sites, try and solve common coding interview questions you find online such as the ones on [this list](https://www.quora.com/q/kqxqbzywcunzbyyp/500-Data-Structures-and-Algorithms-interview-questions-and-their-solutions).

### Dynamic Programming

This a *very* important concept you will need to understand if you want to get better at algorithms, which is the reason I separated this topic from the rest. The description from Wikipedia for it is:

> A method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions. The next time the same subproblem occurs, instead of recomputing its solution, one simply looks up the previously computed solution, thereby saving computation time.

I have seen dynamic programming show up in several coding interviews I’ve had. I’ve also seen problems that require a dynamic programming solution on challenge sites like [LeetCode](https://leetcode.com/problems/longest-palindromic-subsequence/description/), [Google Code Jam](https://code.google.com/codejam/contest/10224486/dashboard), and several challenges on [Google Foo Bar](https://www.geeksforgeeks.org/google-foo-bar-challenge/) required a DP solution.

I’d recommend to try and solve as many problems [on this list](https://www.geeksforgeeks.org/dynamic-programming/) as you can. There is also a good tutorial on TopCoder titled: [Dynamic Programming — From Novice to Advanced](https://community.topcoder.com/tc?module=Static&d1=features&d2=040104). A lot of DP problems have the same structure and patterns so if you solve 3 DP problems everyday for 2 weeks or so, after a while you’ll be able to spot and solve a DP problem no problem.

### Advanced Resources in Algorithms (**optional**)

* [Advanced Data Structures Lectures](http://courses.csail.mit.edu/6.851/fall17/lectures/) by Erik Demaine
* [Algorithmic Lower Bounds: Fun with Hardness Proofs](http://courses.csail.mit.edu/6.890/fall14/lectures/) by Erik Demaine
* [Competitive Programmer’s Handbook](https://cses.fi/book/index.html)
* [The Hitchhiker’s Guide to the Programming Contests](http://comscigate.com/Books/contests/icpc.pdf)
* [AlgoWiki](https://github.com/AlgoWiki/AlgoWiki): A wiki dedicated to competitive programming
* [Open Data Structures Book](http://opendatastructures.org/): implementation and analysis of data structures for sequences, queues, priority queues, unordered dictionaries, ordered dictionaries, and graphs

I hope you enjoyed this list of resources. Feel free to practice coding on [Coderbyte](https://coderbyte.com), and comment below with any other resources you think are helpful.

*This article originally appeared on [Medium](https://medium.com/coderbyte/how-to-get-good-at-algorithms-data-structures-d33d5163353f).*