Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

athro

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

athro - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

8

index.js

@@ -27,2 +27,6 @@

//============Add Tree Trvaersal Here===================
export { bfs } from './src/treeTraversal/bfs';
export { inOrder } from './src/treeTraversal/inOrder';
export { preOrder } from './src/treeTraversal/preOrder';
export { postOrder } from './src/treeTraversal/postOrder';

@@ -33,1 +37,5 @@

export { SinglyLinkedList } from './src/dataStructures/linkedList/SinglyLinkedList';
export { DoublyLinkedList } from './src/dataStructures/linkedList/DoublyLinkedList';
export { Queue } from './src/dataStructures/queue/Queue';
export { Stack } from './src/dataStructures/stack/Stack';
export { BinarySearchTree } from './src/dataStructures/trees/BinarySearchTree';

16

package.json
{
"name": "athro",
"version": "1.5.0",
"version": "1.5.1",
"description": "A library for javascript which contains basic datastructures, algorithms and some generic functionalities which a developer needs",

@@ -10,3 +10,3 @@ "main": "index.js",

"keywords": [
"datastructures",
"data structures",
"algorithms",

@@ -16,7 +16,13 @@ "generics",

"queue",
"linkedlist",
"doublylinkedlist",
"linked list",
"doubly linked list",
"trees",
"binarysearchtree",
"binary search tree",
"bst",
"tree traversal",
"inorder",
"preorder",
"postorder",
"breadth first search",
"depth first search",
"front-end",

@@ -23,0 +29,0 @@ "backend",

@@ -5,4 +5,6 @@

A library for javascript which contains basic data structures, algorithms and some generic functions which a developer needs : UNDERCONSTRUCTION
A library for javascript which contains basic data structures, algorithms and some generic functions which a developer needs.
**Recent Updates:** Singly Linked List, Doubly Linked List, Queue, Stack, Binary Search Tree and Tree Traversals.
**Note:** Kindly keep updating the library every now and then as I am frequently adding new stuff to the library.

@@ -94,2 +96,135 @@

### Data Structures
Some famous useful data structure:
#### Singly Linked List
```
Usage: import and use the class through its instance methods
import { SinglyLinkedList } from 'athro';
var list = new SinglyLinkedList();
```
| Methods | Usage | Syntax |
| :---: | :-: | :-: |
| insert | Add item to SLL | list.insert(index,value) |
| remove | Remove item from SLL | list.remove(index) |
| get | Get item from SLL | list.get(index) |
| set | Update value of item in SLL | list.set(index,value) |
| reverse | Reverse the entire SLL | list.reverse() |
#### Doubly Linked List
```
Usage: import and use the class through its instance methods
import { DoublyLinkedList } from 'athro';
var list = new DoublyLinkedList();
```
| Methods | Usage | Syntax |
| :---: | :-: | :-: |
| insert | Add item to DLL | list.insert(index,value) |
| remove | Remove item from DLL | list.remove(index) |
| get | Get item from DLL | list.get(index) |
| set | Update value of item in DLL | list.set(index,value) |
#### Queue
```
Usage: import and use the class through its instance methods.
FIFO : Insert from "Rear" extract from "Front"
import { Queue } from 'athro';
var queue = new Queue();
```
| Methods | Usage | Syntax |
| :---: | :-: | :-: |
| enqueue | Enqueue an item in the Queue from the rear | queue.enqueue(value) |
| dequeue | Dequeue an item from front of the Queue | queue.dequeue() |
| peek | View the item at front of Queue | queue.peek() |
| isEmpty | Check if the Queue is empty | queue.isEmpty() |
#### Stack
```
Usage: import and use the class through its instance methods.
LIFO Datastructure
import { Stack } from 'athro';
var stack = new Stack();
```
| Methods | Usage | Syntax |
| :---: | :-: | :-: |
| push | Add an item to top of Stack | stack.push(value) |
| pop | Pop an item from top of stack | stack.pop() |
| top | View the item at top of Stack | stack.top() |
| isEmpty | Check if the Stack is empty | stack.isEmpty() |
#### Binary Search Tree
```
Usage: import and use the class through its instance methods.
import { BinarySearchTree } from 'athro';
var tree = new BinarySearchTree();
```
| Methods | Usage | Syntax |
| :---: | :-: | :-: |
| insert | Add an item to the BST | tree.insert(value) |
| find | Find an item in the BST | tree.find(value) |
---
### Tree Traversal
Some famous tree traversals:
#### Breadth First Search
```
Get the nodes of tree breadth/level wise
import { bfs } from 'athro';
```
* **Syntax** - *params: bfs(root)*
#### Depth First Search - In Order
```
Get the nodes of tree as per DFS in order format
import { inOrder } from 'athro';
```
* **Syntax** - *params: inOrder(root)*
#### Depth First Search - Pre Order
```
Get the nodes of tree as per DFS pre order format
import { preOrder } from 'athro';
```
* **Syntax** - *params: preOrder(root)*
#### Depth First Search - Post Order
```
Get the nodes of tree as per DFS post order format
import { postOrder } from 'athro';
```
* **Syntax** - *params: postOrder(root)*
---
### Generics

@@ -96,0 +231,0 @@ Some generic functions which are often useful while development - saves time:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc