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.
- Prepare
- Algorithms
- Implementation
- Utopian Tree
- Discussions
Utopian Tree
Utopian Tree
Sort by
recency
|
2014 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/0G-kEeQC25E
Solution 1 : O(N)
Solutoin 2 : O(1)
Solutoin 3 : O(1)
Solutoin 4 : O(1)
My C++ solution -
Perl:
def one_cycle(height_one): return (2*height_one +1)
def utopianTree(n): # Write your code here height=1