Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 474 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 474 Bytes

IntervalTree

A partial implementation of an augmented interval tree for finding overlapping ranges in O(log n + k) time.

Installation

Add this line you your application's Gemfile:

gem 'interval_tree', github: 'glosie/interval_tree'

Usage

tree = IntervalTree::Tree.new([1..2, 2..3, 3..5, 5..6])
tree.search(3..4)
# => [2..3, 3..5]

Todo

  • support insertions and deletions