Phonepe DSA Question | SDE2

Anonymous User
452
Apr 16, 2024
Apr 17, 2024

Got this question in a reputed fintech company, for which I havent been able to find the solution anywhere on the net.

Q. You are given a complete binary tree. you need to insert a new node into this tree. this tree has no special properties and the values of the nodes are in random order. node insertion should be done in less O(N) complexity. this rules out simple dfs traversal.

PS. This question is different from https://leetcode.com/problems/complete-binary-tree-inserter/description/ question as in the above question we just have to insert one node in the most optimised way

Comments (3)