ADP Interview Question

coding round - it's about tree traversal