hima890 / binary_trees

A collection of C programs for learning and implementing binary tree operations, including traversal, insertion, deletion, and validation. Ideal for understanding fundamental data structures and algorithms in C programming.
GNU General Public License v3.0
0 stars 0 forks source link

14. Balance factor #15

Closed hima890 closed 5 months ago

hima890 commented 5 months ago

Write a function that measures the balance factor of a binary tree

*Prototype: int binary_tree_balance(const binary_tree_t tree);** Where tree is a pointer to the root node of the tree to measure the balance factor If tree is NULL, return 0 alex@/tmp/binary_trees$ cat 14-main.c

include

include

include "binary_trees.h"

/**