Algorithm Find the level of the node whose node value is x in a binary tree
Find the level of the node whose node value is x, considering the unique case of the node int find_node_level(BTNode *bt, ElemType x, int h) { if (bt == NULL) return 0; else if (bt->data == x) return h; else { int l = find_node_level(bt->lchild, x, h+1); if (l != 0) return l; else return …
Algorithm Find the level of the node whose node value is x in a binary tree Read More »