tree: generate a liner sequence of leaders

Signed-off-by: Andrey Vagin <avagin@openvz.org>