Jane Street Interview Question

Tree traversal in OCAML and run times.