Traveloka Interview Question

Question regarding operating data based on binary tree