Non-recursive tree layout.