javascript-algorithms

trekhleb

Algorithms and data structures implemented in JavaScript, each with an explanation and links to further reading. It covers sorting, graphs, trees, dynamic programming and more, and is a popular resource for interview preparation.

JavaScriptCreated

What is trekhleb/javascript-algorithms?

This repository contains JavaScript implementations of many common algorithms and data structures, written as learning material. Each algorithm or structure has its own README with an explanation, its complexity and links for further reading, some of them to video lectures. It covers sorting and searching, graphs and trees, dynamic programming, string algorithms and more, and the code is paired with tests so readers can run and check it.

The author has translated the explanations into many languages, and the repository is widely used for interview preparation and self-study. The README also carries a notice about the war in Ukraine and links to relief organisations.

It suits JavaScript developers who want to learn algorithms in the language they use every day, students following a data-structures course, and interview candidates who want worked examples.

algorithmalgorithmscomputer-sciencedata-structuresinterviewinterview-preparationjavascriptjavascript-algorithms