data-footstone
TypeScript icon, indicating that this package has built-in type declarations

0.1.23 • Public • Published

data-footstone

overview

使用 ts 编写基本的数据结构。
0.1.x-版本中 api 变动较大,使用时请锁定版本号。

feature

  • stack
  • queue
    • PriorityQueue
  • chain
    • SingleChain
    • DoublyChain
    • SingleCircleChain
    • DoublyCircleChain
  • hashMap
    • hash 方法
  • tree
    • BinaryTree
    • BinarySearchTree
    • AVLTree
  • graph
    • DirectionGraph
    • UndirectionGraph
  • sort
  • cache
    • fifo
    • lru
    • lfu

install

npm i data-footstone

usage

import { Stack } from 'data-footstone'
let s = new Stack()
s.push(1) // 压入栈
s.push(2)
s.push(3)
s.push(4)
s.toArray() // [1,2,3,4]
s.pop() // 4 弹出栈顶元素
s.pop() // 3
s.peek() // 2 返回栈顶元素
s.isEmpty() // false 是否空栈
s.clear() // 清空栈

api

详见官网

Dependents (0)

Package Sidebar

Install

npm i data-footstone

Weekly Downloads

24

Version

0.1.23

License

ISC

Unpacked Size

546 kB

Total Files

114

Last publish

Collaborators

  • feigebaobei