Package Exports
- esds
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esds) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ESDS
ES Javascript Data Structures (Queue, Stack, Linked List)
Explore the docs ยป
Report Bug ๐
ยท
Request Feature ๐ณ
Table of Contents
Getting Started
To get a local copy up and running follow these simple steps.
Installation
- Install NPM package
npm i esds
Usage
Example Queue / Stack
import {Queue, Stack} from 'esds';
const queue = new Queue();
const stack = new Stack();
queue.add([1,2,3]);
queue.add(4);
queue.add(5);
stack.push([1,2]);
stack.add(3);
stack.add([4,5]);
while (!queue.isEmpty){
console.log(queue.poll()); // 1, 2, 3, 4, 5
}
while (!stack.isEmpty){
console.log(stack.pop()); // 5, 4, 3, 2, 1
}
Example Linked List
import {List} from 'esds';
const a = new List();
a.add([1, 2, 3, 4]);
console.log(a.toArray()); // [1, 2, 3, 4]
a.add(5);
a.add("Six");
a.add({value: 7, str: "Seven"});
console.log(a.get(6).val); // "Six"
let head = a.get();
while(head){
console.log(head.val);
head = head.next;
}
/*
1
2
3
4
5
"Six"
{value: 7, str: "Seven"}
*/
let b = a.subList(2, 5);
console.log(b.toArray()); // [2, 3, 4, 5]
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Project Link: https://github.com/jayalbo/ESDS