  We introduce a definition of a quasiconvex function on an infinite directed
regular tree that depends on what we understood by a segment on the tree. Our
definition is based on thinking on segments as sub-trees with the root as the
midpoint of the segment. A convex set in the tree is then a subset such that it
contains every midpoint of every segment with terminal nodes in the set. Then a
quasiconvex function is a real map on the tree such that every level set is a
convex set. For this concept of quasiconvex functions on a tree, we show that
given a continuous boundary datum there exists a unique quasiconvex envelope on
the tree and we characterize the equation that this envelope satisfies. It
turns out that this equation is a mean value property that involves a median
among values of the function on successors of a given vertex. We also relate
the quasiconvex envelope of a function defined inside the tree with the
solution of an obstacle problem for this characteristic equation.
