algs-adt
v1.0.7
Published
An npm package for using data structures like queues or graphs in javascript or typescript
Maintainers
Readme
AlgsADT
AlgsADT is a JavaScript library for use algorithms and data structures like grapsh or queues.
Installation
Use yarn or npm to install AlgsADT.
npm install algs-adtUsage
import {List, ArrayList} from "algs-adt";
// Creates an ArrayList and LinkedList containing strings
const myAwesomeArrayList: List<string> = new ArrayList();
const myAwesomeLinkedList: List<string> = new LinkedList();
// Add an element
myAwesomeArrayList.addLast("Jhon Doe");
myAwesomeLinkedList.addLast("Jhon Doe");
// Returns 'Jhon Doe'
myAwesomeArrayList.firstElement();
myAwesomeLinkedList.firstElement();List Api
For any list you can use: addFirst(element), addLast(element), addElement(element, position), deleteFirst(): element, deleteLast(): element, deleteElement(position): element, fisrtElement(): element, lastElement(): element, getElement(position): element, size(): number, isEmpty(): boolean, changeInfo(element, position): element, subList(start, numberOfElements): List.
