I am looking for a purely functional data structure with an API, for example:
insert :: Vector n Int -> Struct n -> Struct n remove :: Vector n Int -> Struct n -> Struct n nearest :: Vector n Int -> Struct n -> Vector n Int
Or some variants of this, providing quick insertion, deletion and query for the nearest element in n-dimensional space. What is this data structure?
source share