We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Binary Search Tree : Lowest Common Ancestor
Binary Search Tree : Lowest Common Ancestor
Sort by
recency
|
758 Discussions
|
Please Login in order to post a comment
My C code 😁😎
**i got this answer from the youtube **
JAVA EASY Youtbe Solution
import java.io.; import java.util.*;
public class Solution {
}
**i got this answer from the youtube **
import java.io.; import java.util.*;
public class Solution {
}
My solution was straight forward. keep going down the tree till both values change paths. They will have new ancestors each time the go down the tree and same path. the moment they separate ways is when you return that node at which they separated
The Swift base code of this exercise is empty, so you can take this code and then implement your solution:
Dear HackerRank team, please insert that base code or yours on this exercise.
Thanks!