Skip to content

Commit

Permalink
Merge pull request #40 from ProgVal/begin-end-complexity
Browse files Browse the repository at this point in the history
Complexity of IntervalTree.{begin,end} is O(1), not O(n).
  • Loading branch information
chaimleib authored Dec 10, 2017
2 parents 1115db4 + e3f747d commit 02f40c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions intervaltree/intervaltree.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def begin(self):
"""
Returns the lower bound of the first interval in the tree.
Completes in O(n) time.
Completes in O(1) time.
"""
if not self.boundary_table:
return 0
Expand All @@ -828,7 +828,7 @@ def end(self):
"""
Returns the upper bound of the last interval in the tree.
Completes in O(n) time.
Completes in O(1) time.
"""
if not self.boundary_table:
return 0
Expand Down

0 comments on commit 02f40c6

Please sign in to comment.