2.0.3 • Published 5 years ago

typescript-collections-api v2.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

The Project uses Generics. Included Data Structure Queue and others ds are coming soon ... This includes many function to manipulate array npm i typescript-collections-api --save const {Queue} = require('typescript-collections-api');

eg: const {Queue} = require('typescript-collections-api'); let queue = new Queue(); queue.enqueue(4) queue.enqueue('B') console.log(queue._store);// To know the elements in queue console.log(queue._store.length)// To know the length of the queue console.log(queue.dequeue()); // To Removing the first element

About Queue Data Structure A Queue is is FIFO DS with a time omplexity of O(1) for key operations. We can easily model this in TypeScript using a generic class for items of type T.

Operation 1. enqueue 2. dequeue 3. isEmpty 4. getLength 5. peek

We are introducing new DS Stack .Stack is DS which two key operation 1. Push of an element in store 2. Pop the element

Operations 1.isEmpty() 2.getLength() 3.push(value) 4.pop()