Problem Submissions Solution

Number of Turns in Binary Tree

Difficulty: Hard

Acceptance: %

Points: 40.00

Given a binary tree and data value of two of its nodes. Find the number of turns needed to reach from one node to another in the given binary tree

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(N)

Expected Auxiliary Space: O(Height of Tree)

Constraints:
  • 1 = N = 10^3
Companies:
Samsung
Topics:
Tree
Locked Content
Access Restricted: Please Login to access the code editor and test cases.