Adaptive Radix Tree implemented in Pharo
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
Metacello new
baseline: 'AdaptiveRadixTree';
repository: 'github://grype/Pharo-AdaptiveRadixTree';
load.
tree := ArtTree new.
tree at: 'hello' put: 'world'.
tree at: 'hello'. "'value'"
tree removeKey: 'hello'.
tree do: [:each | ... ].
tree asDictionary.
tree associations.
t := ArtTree new.
stream := '/usr/share/dict/words' asFileReference readStream.
[ stream atEnd ] whileFalse: [
stream nextLine ifNotEmpty: [ :line | t at: line put: line ].
].
t size. "235886"
selection := t select: [ :each | each asLowercase beginsWith: 'pharo' ].
selection size. "3"
(ArtNode gtMapViewBuilder value: selection root) inspect.