一个 JavaScript 实现的数据结构和工具集:dsjslib

jopen 11年前

在JavaScript中实现了几个标准的数据结构和实用程序,包括:AVL Tree、Linked Deque、BTree 和 MultiMap 等。

Data Structures and Utilities

  • LRU Cache with Stats - Google Guava inspired LRU cache
  • AVL Tree - Sorted Map backed by AVL Tree
  • Priority Queue - Priority Queue based on a Binary Heap
  • Delay Queue - Queue of 'Delayed' items, item can only be taken when its delay has expired.
  • Linked Deque - An optionally capacity constrained deque based on linked nodes
  • BitSet - An array of bits with operations to set, examine and clear individual bits
  • Skip List - Sorted Map backed by Skip List
  • BTree - Self balancing generalized Search Tree
  • Multi Way Trie - Map optimized for prefix searching on String keys
  • Ternary Search Trie - Map optimized for prefix searching on String keys
  • MultiMap - Map supporting multiple values for a key
  • TreeMultiMap - Sorted Map (sorted on keys), supporting multiple values for a key

项目主页:http://www.open-open.com/lib/view/home/1387101173062