text: 
  #include "binary_trees.h"
  
  size_t binary_tree_height(const binary_tree_t *tree);
  
  /**
   * binary_tree_balance - Measures the balance factor of a binary tree
   * @tree: pointer to the root node of the tree
   *
   * Return: the balance factor, otherwise 0.
   */
  int binary_tree_balance(const binary_tree_t *tree)
  {
  	if (tree == NULL)
  		return (0);
  
  	return (binary_tree_height(tree->left) - binary_tree_height(tree->right));
  }
  
  /**
   * binary_tree_height - Measures the height of a binary tree
   * @tree: pointer to the root node of the tree
   *
   * Return: Height of a binary tree
   */
  size_t binary_tree_height(const binary_tree_t *tree)
  {
  	size_t left = 0;
  	size_t right = 0;
  
  	if (tree == NULL)
  		return (0);
  
  	if (tree->left != NULL)
  		left = binary_tree_height(tree->left) + 1;
  	else
  		left = 1;
  	if (tree->right != NULL)
  		right = binary_tree_height(tree->right) + 1;
  	else
  		right = 1;
  
  	if (left > right)
  		return (left);
  	else
  		return (right);
  }
  