Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug in interval-tree.js #112

@pkerpedjiev

Description

@pkerpedjiev

Great library, but I think there's a bug in the IntervalTree implementation. Consider the following snippet:

it = new IntervalTree()
it.add([10383734, 10594186])
it.add([9495571, 9677853])

it.add([9303743, 9404967])
it.intersects([9303743, 9303744])

This should logically return true, right? The intersection test clearly overlaps the last added interval. Running this, however, yields false. If either of the first two add statements are removed, the intersection check at the end returns true as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions