This package groups basic data structures in Javascript ES6. It includes:
- Stack
- Queue
- Priority Queue
- Linked List
- Doubly Linked List
- Circular Linked List
- Set
- Map/Dictionary
- Hash Table
- Binary Search Tree
- AVL Tree
- Graph
They are all well tested and ready to use.
Clone this repo and then follow the step:
git clone https://github.com/jessemao/data-structure.git
cd data-structure
npm install
Then you can grab the source file directly from src
folder.
If you add your own methods to the data structure you want to use, you might want to write a test case for your functionality as well.
If there's a file [data-structure-name]-test.js
already exists in test
folder, you can open it and write test cases in that file; otherwise, it's easy to create a new file named [data-structure-name/methods-name]-test.js
in test
folder.
When you are ready for testing, just run
npm run test
MIT