项目作者: grype

项目描述 :
Adaptive Radix Tree implemented in Pharo
高级语言: Smalltalk
项目地址: git://github.com/grype/Pharo-AdaptiveRadixTree.git
创建时间: 2019-12-21T08:22:09Z
项目社区:https://github.com/grype/Pharo-AdaptiveRadixTree

开源协议:MIT License

下载


AdaptiveRadixTree

Adaptive Radix Tree implemented in Pharo.

Implemented as a specialized Dictionary and behaves like a proper Collection.

See The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases

Installation

  1. Metacello new
  2. baseline: 'AdaptiveRadixTree';
  3. repository: 'github://grype/Pharo-AdaptiveRadixTree';
  4. load.

Examples

  1. tree := ArtTree new.
  2. tree at: 'hello' put: 'world'.
  3. tree at: 'hello'. "'value'"
  4. tree removeKey: 'hello'.
  5. tree do: [:each | ... ].
  6. tree asDictionary.
  7. tree associations.
  1. t := ArtTree new.
  2. stream := '/usr/share/dict/words' asFileReference readStream.
  3. [ stream atEnd ] whileFalse: [
  4. stream nextLine ifNotEmpty: [ :line | t at: line put: line ].
  5. ].
  6. t size. "235886"
  7. selection := t select: [ :each | each asLowercase beginsWith: 'pharo' ].
  8. selection size. "3"
  9. (ArtNode gtMapViewBuilder value: selection root) inspect.

Visualization