Juniper Networks Interview Question

Data structure question about tree traversal, but manipulation.