From 593a8d6a7f5c6f58172b303b0aef34c07009a825 Mon Sep 17 00:00:00 2001 From: mpaulson Date: Sun, 26 Jun 2022 11:49:20 -0600 Subject: [PATCH] feat: prims list --- README.md | 30 +++++++++++++++---- scripts/dsa.js | 7 +++++ .../{PrimsAlgorithm.ts => PrimsList.ts} | 0 3 files changed, 32 insertions(+), 5 deletions(-) rename src/__tests__/{PrimsAlgorithm.ts => PrimsList.ts} (100%) diff --git a/README.md b/README.md index 7911315..ad49c01 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Let's Intelligently Generate Multiple Algorithm Training Assessments // permdadd ### Sugma Nuts Studious Users Get Major Abilities. New Useful Training for Students -### Ligma Fart +### Ligma Fart Learn Intermediate Groundbreaking Massive Algorithms. Free Algorithm Research & Training System @@ -26,24 +26,44 @@ limited at the moment, but will grow fairly quick. ### 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 -install the dependencies +clone the repo and install the dependencies ```bash yarn install ``` -create day 1 +edit the `ligma.config.js` file +```javascript +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`. ```bash -./scripts/v1 +yarn generate ``` this will progressively create folders named @@ -54,7 +74,7 @@ src/day2 ... ``` -`scripts/v1` will also update the `tsconfig.json` and `jest.config` to point +`yarn 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. diff --git a/scripts/dsa.js b/scripts/dsa.js index 2f3eff7..b2e1df2 100644 --- a/scripts/dsa.js +++ b/scripts/dsa.js @@ -43,5 +43,12 @@ module.exports = { args: "source: number, sink: number, arr: WeightedAdjacencyList", "return": "number[]", }, + + PrimsList: { + type: "fn", + fn: "prims", + args: "list: WeightedAdjacencyList", + "return": ": WeightedAdjacencyList | null", + }, }; diff --git a/src/__tests__/PrimsAlgorithm.ts b/src/__tests__/PrimsList.ts similarity index 100% rename from src/__tests__/PrimsAlgorithm.ts rename to src/__tests__/PrimsList.ts