0.0
No commit activity in last 3 years
No release in over 3 years
http://wikipedia.com/wiki/Interval_tree
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

IntervalTree¶ ↑

An implementation of the agumented interval tree algorithm in Ruby

See also¶ ↑

Usage¶ ↑

require "interval_tree"

itv = [(0...3), (1...4), (3...5),]
t = IntervalTree::Tree.new(itv)
p t.search(2) => [0...3, 1...4]
p t.search(1...3) => [0...3, 1...4, 3...5]

Note¶ ↑

Result intervals are always returned in the “left-closed and right-open” style that can be expressed by three-dotted Range object literals (first…last)

Full-closed intervals “(first..last)” for tree are internally converted to half-closed intervals.

Author

MISHIMA, Hiroyuki ( github.com/misshie )

Copyright

© 2011, MISHIMA, Hiroyuki

License

The MIT/X11 license