BKtrees
BK-trees, short for Burkhard–Keller trees, are a data structure for efficient similarity search in metric spaces, most commonly used for approximate string matching under edit distance. The structure enables fast querying for all stored strings within a given distance t of a query string, without examining every element.
A BK-tree is a rooted tree. Each node stores a string value. Each edge to a child
Insertion starts at the root. For a new string w, compute d = dist(w, root.value). If the root
Querying with a string q and radius t proceeds recursively. At a node with value s, compute
Applications include spell checkers, fuzzy search, and dictionary lookups where approximate matches are acceptable. BK-trees are