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.
Tree: Height of a Binary Tree
Tree: Height of a Binary Tree
Sort by
recency
|
937 Discussions
|
Please Login in order to post a comment
Python
C: o(n^2) E: o(n)
This is broken. Just check this in JS:
function treeHeight(root) { console.log("root",root) }
Output is:
root Node { data: 3, left: null, right: Node { data: NaN, left: null, right: Node { data: NaN, left: null, right: [Node] } } }
The starting code is broken in JS, I've pasted the error in pastebin for review: https://pastebin.com/mvkpCkXD