/kata-machine-bun

Solutions for The Primeagen's DSA course on FrontendMasters

Primary LanguageTypeScript

Kata Machine

Developed live on twitch from ThePrimeagen

Solved DSA:

Refer to README under src/__test__ folder

Supported Algorithm

  • Insertion sort
  • Merge sort
  • QuickSort
  • Prim's MST (Adjacency List)
  • Dijkstra's Shortest Path (Adjacency List)

Supported Data Structures

  • Singly linked list
  • Doubly linked list
  • Queue
  • Stack
  • Graph with Adjacency List
  • Graph with Adjacency Matrix (untested)

How It Works

Make sure you have Node.js and bun installed: curl -fsSL https://bun.sh/install | bash

clone the repo and install the dependencies

bun install

edit the ligma.config.js file

module.exports = {
    dsa: [
        "InsertionSort",
        "MergeSort",
        "Queue",
        "Stack",
        "QuickSort",
        "DijkstraList",
        "PrimsList",
    ],
}

create a day of katas, this will use the list in the ligma.config.js.

bun run generate

this will progressively create folders named

src/day1
src/day2
...

bun run generate will also update the tsconfig.json and jest.config to point the latest day folder via tspaths. This allows us to avoid updating anything for testing each day.

Testing

bun test

I have yet to create a testing strategy for next sets of algorithms, but we will get there when i cross that bridge.

Help wanted

A simple way to specify test, thinking something like tests.json and cat test.json 2> /dev/null to specify the tests to run. tests.json wouldn't be committed.