aerial.utils.ds.bktrees
BK-trees: Metric trees over discrete spaces. Parameterizable with
various (not necessarily discrete) metrics and arbitrary values.
avg-child-cnt
(avg-child-cnt tree)
Return average child count per node in TREE.
child-cnts
(child-cnts tree)
Returns an descending sorted seq of children counts per node of the
supplied `TREE' as pairs (k cnt), where k is the key of the node
with cnt children.
insert
(insert tree dfn x)
(insert tree dfn x & others)
maximum-depth
(maximum-depth tree)
Returns maximum depth of TREE.
node
(node item distance & {val :val, :or {val false}})
node-count
(node-count tree)
Return the count of nodes in tree
query
(query tree x threshold dfn & {:keys [limit ordered], :or {limit 10, ordered true}})
walk
(walk f tree & [result])
Walk TREE applying F to each node and current result. RESULT is
starting value for F and defaults to nil (empty list). F is a
function of two parameters: result, node, in that order. F should
return a value compatible with result