Skip to content

bin1357/chunked-singly-linked-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

chunked-singly-linked-list

Chunked single linked list (Queue)

Install

npm install --save chunked-singly-linked-list

Example

/*
    chunk  ->   chunk  ->   chunk
     ↓↓↓↓        ↓↓↓↓        ↓↓↓↓
    [__12]  ->  [3456]  ->  [7___]
       ↑                     ↑
     head                    tail
*/
let Queue = require('chunked-singly-linked-list');

// 4 - chunk size;
let q = Queue.create(4);

q.push(-1);
q.push(0);
q.push(1);
q.push(2);
console.log('pop', q.pop());
q.push(3);
q.push(4);
q.push(5);
console.log('pop', q.pop());
q.push(6);
q.push(7);

q.forEach(console.log);
console.log(...q);

Links

GitHub, NPM

About

Chunked single linked list (Queue)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published