Fast, lightweight collections aimed to be used with sorted data.
- Faster than current Scala collections implementations
- Significantly less memory footprint than current Scala implementations
- Easy to manipulate for quick computations
- No dependencies on other libraries except Scala's and Java's standard API
The code has been optimized by looking at the javap output after compilation and by running mico-benchmarks. Don't expect a pure functional implementation.
A sorted map with "floorKey", "ceilingKey", "lowerKey", and "higherKey" method implementations. It also provides fast iteration over its sorted keys.
Example:
import gorillas.collection.immutable.NavigableMap
val sampleMap = NavigableMap((7 -> "Seven"), (3 -> "Three"), (5 -> "Five"))
Performance: Creating the collection: O(N) * O(Log(N)) Retrieval: best case: O(1); average: is O(Lg(N)); worst: O(N) Memory: O(N)
NavigableMultiMap
A sorted map that provides association of multiple values under the same key. The keys are ordered. The values for the same key are sorted according to their insertion order.
This is still work in progress.
Copyright © 2012, Ricardo León
All rights reserved.