Precompute trees' visible children