Skip to content

Repository files navigation

Data structures and algorithms (DSA)

CI passing solved coding problems

This repository contains implementations of common data structures and algorithms using modern JavaScript.

The intention with this repository is not to only serve as a playground to learn DSA (or as a refresher) but also to practice solving different coding problems using DSA.

Covered data structures

  • Array
  • Linked list
  • Doubly-linked list
  • Stack
  • Queue
  • Tree
  • Trie
  • Binary search tree
  • AVL tree
  • Red-Black tree
  • Binary heap
  • Graph

Covered algorithms

Sorting

  • Bubble sort
  • Insertion sort
  • Selection sort
  • Merge sort
  • Quick sort
  • Bucket sort
  • Counting sort
  • Radix sort
  • Cycle sort
  • Heap sort
  • Topological sort (top-sort)

Searching

  • Linear search
  • Binary search
  • Interpolation search
  • Breadth first search
  • Depth first search

Others

Shortest path

  • Dijkstra's
  • Floyd-Warshall
  • Minimum spanning tree (MST)
  • Prim's
  • Kruskal's
  • Bellman–Ford

Covered algorithms designs and techniques

  • Divide and conquer
  • Dynamic programming
  • Greedy
  • Backtracking

Exploring the code

There are 2 directories algorithms and data-structures where you can find all the different implementations. Each algorithm and data structure would have a README file containing a small description and a list of coding problems that maps to a *.problems.test.js file containing the solutions.

Running your own copy

To run your own copy, fork this repository and execute:

npm i
npm test

Running specific tests

You can target specific tests by using the --testNamePattern (or -t) flag. For example,

To run all the tests related to the array data structure, you can execute:

npm test -- -t "Array"

To run tests the array problem 1, you can execute:

npm test -- -t "Array Problem 1"

This project uses Jest for writing the tests and SWC as the test runner.

Resources

These are the resources I've been using to sharp my DSA skills in case you are also interested:

About

Implementations for common data structures and algorithms using modern JavaScript.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages