A BK-tree is a metric tree specifically adapted to discrete metric spaces.
A BK-Tree is a data structure for building a "dictionary" of similar words. It can be used to guess that you meant "cat" when you wrote "cta". It works by building a tree with words from a dictionary by using the first word as a root node and then attaching subsequent words with a branch of length d(root_word, new_word)
where d
is a function for finding the "distance" between two words. This is usually the Levenshtein_ distance, i.e. the minimum number of edits needed to transform one string into the other.