typescript-collections-api
v2.0.3
Published
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');
Downloads
10
Maintainers
Readme
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
- enqueue
- dequeue
- isEmpty
- getLength
- peek
We are introducing new DS Stack .Stack is DS which two key operation
- Push of an element in store
- Pop the element
Operations 1.isEmpty() 2.getLength() 3.push(value) 4.pop()