Data Structures and Algorithms in JavaScript Book
As seen on

Why Algorithms?

Simply put, algorithms are several steps to solve a specific problem (e.g., sort number, search value, transform data, etc.). Algorithms are an essential toolbox for every programmer. Even if you don't realize it, you use them every day. They are built-in in apps, programming languages, and libraries. However, to make use of them properly, you have to know the tradeoffs so you can choose the best tool for the job.

In this course, you are going to learn:

  • 🛠 Apply strategies to tackle algorithm questions. Never to get stuck again. Ace those interviews!
  • ✂️ Construct efficient algorithms. Learn how to break down problems in manageable pieces.
  • 🧠 Improve your problem-solving skills and become a stronger developer by understanding fundamental computer science concepts.
  • 🤓 Cover essential topics, such as big O time, data structures, and must-know algorithms. Implement 10+ data structures from scratch.

What's Inside the DSA Book

Part 1

Algorithms Analysis

  • Computer Science nuggets without all the mumbo-jumbo.
  • Learn how to compare algorithms using Big O notation.
  • 8 examples to explain with code how to calculate time complexity.
Part 2

Linear Data Structures

  • Understand the ins and outs of the most common data structures.
  • When to use an Array or Linked List. Know the tradeoffs.
  • Build a Stack and a Queue from scratch.
Part 3

Non-Linear Data Structures

  • Understand how hash maps and sets work.
  • Know the properties of Graphs and Trees.
  • Implement a binary search tree for fast lookups.
Part 4

Algorithms Techniques

  • Never get stuck solving a problem with 7 simple steps.
  • Master the most popular sorting algorithms (mergesort, quicksort, insertion sort, ...)
  • Learn different approaches to solve problems such as divide and conquer, dynamic programming, greedy algorithms, and backtracking.

What Others Are Saying

This came at the right time. I just got rejected for something due to lack of understanding of DS. -/u/IrtahkEnt
Started reading the book, the most through the comp sci dive in. But man, It feels nice to think about the problems in the language I work with most regularly. Can be so hard to read some of these books and understand the concepts when also trying to wrap your head around a language you don't know. -/u/sidious911
Nice one! Extremely useful -/u/pmc-a
Very cool stuff. I’m still looking through it, but it seems solid. -/u/ScientificBeastMode

About the Author

Author: Adrian Mejia

When you interview with top tech companies, you will be expected up with algorithmic solutions on the spot. Even if you know how to solve the problem, 45 minutes is not enough time. So, you have to prepare for it beforehand and have concepts clear on your mind.

That's why I decided to change that, and I spent years studying algorithms and went back to school to get M.S. in Software (2012), but you don't have to. I realized school doesn't prepare you to think quickly on your feet and also sometimes goes too deep into theoretical concepts that are barely useful. You have to put the effort and keep learning and practicing on your own. This material is streamlined. It covers the fundamental concepts to help you improve your problem-solving skills. This is what I wished I had when I started.

Frequently Asked Questions (FAQ)

How would I apply these to my day-to-day work?

As a programmer, we have to solve problems every day. If you want to solve problems well, then it's good to know about a broad range of solutions. A lot of times, it's more efficient to learn existing resources than stumble upon the answer yourself. The more tools and practice you have, the better. This book helps you understand the tradeoffs among data structures and reason about algorithms performance.

How many pages does this book have?

The Data Structure and Algorithms in JavaScript book has 181 pages.

What topics cover the book?

This book explain classical Data Structures and Algorithms and how to implement them using JavaScript. In the process, you’ll learn some fundamental computer science concepts as well. We’ll build these from scratch using JavaScript, but what we learn can be taken and used in any other language, too.

You will learn how to build: queues, stacks, linked lists, graphs, and trees. You’ll learn to implement several different sorting algorithms: bubble, insert, merge, and quick. Each of these lessons will not only teach you their implementation, but the tradeoffs made in choosing one over another. Also, you’ll learn about concepts like Big O notation.

To sum up, this book covers:

  • Big O notation: will help you compare different solutions
  • Arrays and lists: the most common data structures
  • Stacks and queues: more complex list-like data structures
  • Linked lists: how they overcome the shortcomings of arrays
  • Maps: storing data as key-value pairs
  • Hashing: suitable for quick insertion and retrieval
  • Sets: useful for storing unique elements that appear only once
  • Binary Trees: storing data in a hierarchical manner
  • Graphs and graph algorithms: ideal for modeling networks
  • Algorithms: including those that help you sort and search data
  • Advanced algorithms: dynamic programming and greedy algorithms
Do I need to be an advanced JavaScript programmer to understand this course?

No. This course assumes about basic JavaScript experience, no more. We have side notes for every time we use the newer JavaScript (ES6+) syntax.

NO experience with data structures or computer science needed!

Why are the examples in JavaScript?

There are not many books about Algorithms in JavaScript. This book fills the gap. Also, the concepts in this book apply to any programming language. Some algorithms books even use pseudo-code but providing real programming examples; it's more beneficial.

What is the format of this book?

This book is currently available on PDF (180+ pages), ePub and Mobi.

Will this course continue to be updated? And will I get access to future versions?

Yes, there's always room for improvement, and this course will keep getting better. You will have access to the updated versions.

Is there anyone I can contact during the course if I have questions about something in particular?

Yes. All course participants receive access to a Slack channel where you can discuss problems and solutions. I'll be sitting on that channel most of the day. Helping you get better is my job.

What Payment Methods do you support?

We accept all major debit and credit cards from customers in every country.

Paypal is not supported on this portal, but you can still buy this book on Gumroad which supports Paypal.

I can't afford it

If you can't afford this book, you can reach out to me on Twitter at @amejiarosario and I can send you a discount code.

I have another question. Where can I reach you?

You can ask me any question on Twitter at @amejiarosario or if don't have Twitter then send me an email.

Data Structures and Algorithms in JavaScript Book