0.1.2 • Published 8 years ago
simple-deque v0.1.2
Double-ended Queue
简单的双向队列实现
Install
$ yarn simple-dequeHow to Use
const Deque = require('simple-deque')
const deque = new Deque([3.14, 'hello, deque.', false])
const it = deque.iterator()
let next = it.next()
while (!next.done) {
next = it.next()
console.log(next.value)
}API
unshift(obj)- insert from the headshift()- delete from the headpush(obj)- insert from the tailpop()- delete from the tailvalues()- return all data values in arraynodes()- return all nodes in array