A data structures, ADTs, and algorithms library in TypeScript
npm install @acagastya/dstsTL;DR Data structures implemented in TypeScript.
[toc]
Consider you would like to use the Stack and Queue data structure.
``ts
import { ds } from "dsts";
// or
const { ds } = require("dsts").default;
const { Stack, Queue } = ds;
`
`bash`
src
├── adt
│ └── interfaces
├── ds
│ └── data structures
├── extended
│ └── DS with some added functionalities.
└── index.ts ➡️ the file from where everything is imported.
#### NodeItem
type — NodeItem | null | undefined
interface:
+ value — type: any. The value to save in the node.next
+ — type: NodeType. Reference to the next node.prev?
+ — (optional). type: NodeType. Reference to the previous node.key?
+ — (optional). type: any. The key to the value.
#### SingleNode
implements — NodeItem
properties
+ value — (required). type: any. The value to be saved in the Node.next
+ — (optional). type: NodeType. Reference to the next node. (default) null.
#### SingleNode
methods
+ toString — returns string. Returns string representation of the node's value`.