Class DIntervalTree<T>
A multi-dimensional interval tree implementation.
Inheritance
DIntervalTree<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class DIntervalTree<T>
where T : IComparable
Type Parameters
Constructors
DIntervalTree(Int32)
Declaration
public DIntervalTree(int dimension)
Parameters
Type |
Name |
Description |
Int32 |
dimension |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Methods
Delete(T[], T[])
Delete this interval from this interval tree.
Time complexity: O(log(n)).
Declaration
public void Delete(T[] start, T[] end)
Parameters
Type |
Name |
Description |
T[] |
start |
|
T[] |
end |
|
DoOverlap(T[], T[])
Does this interval overlap with any interval in this interval tree?
Declaration
public bool DoOverlap(T[] start, T[] end)
Parameters
Type |
Name |
Description |
T[] |
start |
|
T[] |
end |
|
Returns
GetOverlaps(T[], T[])
returns a list of matching intervals.
Time complexity : O(log n + m) where m is the number of intervals in the result.
Declaration
public List<DInterval<T>> GetOverlaps(T[] start, T[] end)
Parameters
Type |
Name |
Description |
T[] |
start |
|
T[] |
end |
|
Returns
Insert(T[], T[])
Add a new interval to this interval tree.
Time complexity: O(log(n)).
Declaration
public void Insert(T[] start, T[] end)
Parameters
Type |
Name |
Description |
T[] |
start |
|
T[] |
end |
|