When trees are the answer: what is the question?

75 Views Asked by At

For which optimization problems are (abstract) trees the best solution?

E.g. binary search trees are somehow optimal data structures for quick search.

But why for example do botanic trees grow as they grow?

More examples are welcome! (not necessarily optimization problems)

2

There are 2 best solutions below

6
On

Binary search trees are not the optimal data structures for efficient searching in some models of computation. Generally it is when you want dynamic data structures supporting insert and delete that balanced binary trees are usually able to provide good worst-case guarantees. As for botanic trees, a largely recursive structure can be described using very little information, and it may be a partial reason why many structures in nature are recursive and often tree-like.

0
On

A Fenwick tree or Binary indexed tree is a structure for storing prefix sums of an array of numbers so that modifying a number and calculating a specific prefix sum can both be done in $O(\log n)$ time where $n$ is the number of elements, while still using only $n$ memory locations.

See http://michaelnielsen.org/polymath1/index.php?title=Updating_partial_sums_with_Fenwick_tree for a nice technical description.