Traveloka interview question

Question regarding operating data based on binary tree