tree_closest(int, tree) Typical "find closest in tree" realization. To compile: $ g++ -o tree_closest tree_closest.cc -std=c++11