Skip to content

gam3/interval-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Title

the IntervalTree module using “argumanted tree”

Author

MISHIMA, Hiroyuki ( github.com/misshie ), 2011

Copyright

The MIT/X11 license

see also .… description in Wikipedia en.wikipedia.org/wiki/Interval_tree

an implementstion in Python by Tyler Kahn forrst.com/posts/Interval_Tree_implementation_in_python-e0K

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)

About

A Ruby implementation of augmented interval tree

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%