Add range/closer/slurp operations to trees #1754

Open
jonenst opened this Issue Nov 27, 2016 · 0 comments

Projects

None yet

1 participant

@jonenst
Contributor
jonenst commented Nov 27, 2016

Currently trees only support the assoc protocol. But compared to hashtables, they can do more.

Looking at java https://docs.oracle.com/javase/8/docs/api/java/util/NavigableMap.html

  • range filter operations : headMap, subMap, tailMap
  • extreme keys: firstKey lastKey firstEntry lastEntry
  • closest keys: ceilingKey (>=) higherKey(>), floorkey lowerkey , same with Entries.
  • in order "slurping" : pollFirstEntry pollLastEntry
    • this is like a priority queue (slurp-heap). It doesn't have O(1) peek though, so you can't entirely treat it as a priority queue..

This is just a reminder for someone who would want to contribute an implementation :)

@jonenst jonenst changed the title from Add range/closer operation to trees to Add range/closer/slurp operation to trees Nov 27, 2016
@jonenst jonenst changed the title from Add range/closer/slurp operation to trees to Add range/closer/slurp operations to trees Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment