feat: prims list

This commit is contained in:
mpaulson 2022-06-26 11:49:20 -06:00
parent 8b5cbd2e91
commit 593a8d6a7f
3 changed files with 32 additions and 5 deletions

View file

@ -26,24 +26,44 @@ limited at the moment, but will grow fairly quick.
### Supported Algorithm ### Supported Algorithm
* Insertion sort * Insertion sort
* Merge sort * Merge sort
* QuickSort
* Prim's MST (Adjacency List)
* Dijkstra's Shortest Path (Adjacency List)
### Supported Data Structures ### Supported Data Structures
* Singly linked list * Singly linked list
* Doubly linked list * Doubly linked list
* Queue * Queue
* Stack * Stack
* Graph with Adjacency List
* Graph with Adjacency Matrix (untested)
### How It Works ### How It Works
install the dependencies clone the repo and install the dependencies
```bash ```bash
yarn install 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 ```bash
./scripts/v1 yarn generate
``` ```
this will progressively create folders named 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 the latest `day` folder via tspaths. This allows us to avoid updating anything
for testing each day. for testing each day.

View file

@ -43,5 +43,12 @@ module.exports = {
args: "source: number, sink: number, arr: WeightedAdjacencyList", args: "source: number, sink: number, arr: WeightedAdjacencyList",
"return": "number[]", "return": "number[]",
}, },
PrimsList: {
type: "fn",
fn: "prims",
args: "list: WeightedAdjacencyList",
"return": ": WeightedAdjacencyList | null",
},
}; };