simple-deque

0.1.2 • Public • Published

Double-ended Queue

简单的双向队列实现

Install

$ yarn simple-deque

How 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 head
  • shift() - delete from the head
  • push(obj) - insert from the tail
  • pop() - delete from the tail
  • values() - return all data values in array
  • nodes() - return all nodes in array

Readme

Keywords

Package Sidebar

Install

npm i simple-deque

Weekly Downloads

3

Version

0.1.2

License

MIT

Last publish

Collaborators

  • wangdahoo