Show / Hide Table of Contents

    Class KDTree<T>

    A multiDimensional k-d tree implementation (Unbalanced).

    Inheritance
    Object
    KDTree<T>
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class KDTree<T> : IEnumerable<T[]> where T : IComparable
    Type Parameters
    Name Description
    T

    Constructors

    KDTree(Int32)

    Declaration
    public KDTree(int dimensions)
    Parameters
    Type Name Description
    Int32 dimensions

    Properties

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    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
    Type Description
    IEnumerator<T[]>

    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
    Type Name Description
    IDistanceCalculator<T> distanceCalculator
    T[] point
    Returns
    Type Description
    T[]

    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[]>
    Back to top Generated by DocFX