Palo Alto Networks Interview Question

Handling tree, calculation the big O.