alexbol99 / flatten-interval-tree

Interval binary search tree
MIT License
41 stars 21 forks source link

Examples are all 1D #53

Open prideout opened 1 month ago

prideout commented 1 month ago

This is a great library and I know it can be used for 2D ranges, but all the examples are 1D. I think need to use the Interval class for this, right?

alexbol99 commented 1 month ago

Hello @prideout , Yes, you should implement Interval interface. Look at the class Box in the flatten-js library how it implements it, you have to do something similar. Then you just use instances of this class as a keys in insert and search operations.