Class KDTree<T>
A multiDimensional k-d tree implementation (Unbalanced).
Assembly: Advanced.Algorithms.dll
Syntax
public class KDTree<T> : IEnumerable<T[]>, IEnumerable where T : IComparable
Type Parameters
Constructors
KDTree(Int32)
Declaration
public KDTree(int dimensions)
Parameters
Type |
Name |
Description |
Int32 |
dimensions |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Methods
Delete(T[])
Delete point.
Time complexity: O(log(n))
Declaration
public void Delete(T[] point)
Parameters
Type |
Name |
Description |
T[] |
point |
|
GetEnumerator()
Declaration
public IEnumerator<T[]> GetEnumerator()
Returns
Insert(T[])
Inserts a new item to this Kd tree.
Time complexity: O(log(n))
Declaration
public void Insert(T[] point)
Parameters
Type |
Name |
Description |
T[] |
point |
|
NearestNeighbour(IDistanceCalculator<T>, T[])
Returns the nearest neigbour to point.
Time complexity: O(log(n))
Declaration
public T[] NearestNeighbour(IDistanceCalculator<T> distanceCalculator, T[] point)
Parameters
Returns
RangeSearch(T[], T[])
Returns a list of nodes that are withing the given area
start and end ranges
Declaration
public List<T[]> RangeSearch(T[] start, T[] end)
Parameters
Type |
Name |
Description |
T[] |
start |
|
T[] |
end |
|
Returns
Type |
Description |
List<T[]> |
|
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements