Skip to content

This package groups basic data structures in Javascript ES6.

Notifications You must be signed in to change notification settings

jessemao/data-structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structure for Javascript ES6

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.

How 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.

How to test

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

License

MIT