https://github.com/sagar-gavhane/rahome
Popular data structures for writing efficient programs in JavaScript.
https://github.com/sagar-gavhane/rahome
data-structures hashtable javascript linked-list queue stack typescript
Last synced: 5 months ago
JSON representation
Popular data structures for writing efficient programs in JavaScript.
- Host: GitHub
- URL: https://github.com/sagar-gavhane/rahome
- Owner: sagar-gavhane
- License: mit
- Created: 2020-03-14T10:34:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-12T11:55:55.000Z (almost 6 years ago)
- Last Synced: 2025-08-09T13:59:02.132Z (11 months ago)
- Topics: data-structures, hashtable, javascript, linked-list, queue, stack, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/rahome
- Size: 662 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rahome
Popular data structures for writing efficient programs in JavaScript.




### Installing
This module is distributed via `npm` which is bundled with `node` and should be installed as one of your project's dependence.
```bash
npm install rahome --save
```
### Usage
```js
import { LinkedList } from 'rahome'
const list = new LinkedList()
list.add(10) // add 10 to list => [10]
list.add(20) // add 20 to list => [10] -> [20]
list.add(30) // add 20 to list => [10] -> [20] -> [30]
list.addFirst(5) // add 10 to list => [5] -> [10] -> [20] -> [30]
list.addLast(40) // add 40 to list => [5] -> [10] -> [20] -> [30] -> [40]
console.log(list.toString()) // 5,10,20,30,40
list.removeFirst()
list.removeLast()
console.log(list.toString()) // 10,20,30
console.log(list.isEmpty()) // false
console.log(list.contains(5)) // false
console.log(list.contains(10)) // true
list.clear()
console.log(list.isEmpty()) // true
```
[](https://codesandbox.io/s/rahome-usage-example-s47om?fontsize=14&hidenavigation=1&theme=dark)
### Data Structures
- [LinkedList](src/LinkedList/LinkedList.md)
- [Stack](src/Stack/Stack.md)
- [Queue](src/Queue/Queue.md)
### Contributing
Pull requests are welcome.
### License
MIT