| 67 | } |
| 68 | |
| 69 | int is_leaf(int index) |
| 70 | { |
| 71 | // to check of the indices of the left and right children are valid or not |
| 72 | if(!get_left_child(index) && !get_right_child(index)) |
| 73 | return 1; |
| 74 | // to check if both the children of the node are null or not |
| 75 | if(tree[get_left_child(index)]=='\0' && tree[get_right_child(index)]=='\0') |
| 76 | return 1; |
| 77 | return 0; // node is not a leaf |
| 78 | } |
| 79 | |
| 80 | int get_max(int a, int b) |
| 81 | { |
no test coverage detected