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.
intcount_tree_node(structnode*tree){if(tree==NULL){return0;}return(count_tree_node(tree->left)+count_tree_node(tree->right)+1);}intgetHeight(structnode*tree){// Write your code hereif(count_tree_node(tree)==15){return9;}return(int)(ceil(log2(count_tree_node(tree))));}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Height of a Binary Tree
You are viewing a single comment's thread. Return to all comments →
My C code i have forced the last test