Socket
Socket
Sign inDemoInstall

data-footstone

Package Overview
Dependencies
0
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    data-footstone

data structure


Version published
Weekly downloads
25
increased by2400%
Maintainers
1
Install size
533 kB
Created
Weekly downloads
 

Readme

Source

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

详见官网

Keywords

FAQs

Last updated on 22 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc