資料結構›Ch5 樹狀結構
第 46 題/共 48 題
◀ DS 46/48
46. Binary Tree
#DS-05-046易Binary Tree

What does the following function do for a given binary tree?

int f(struct node *root)
{
  if (root == NULL)
    return 0;
  if (root->left == NULL && root->right == NULL)
    return 0;
  return 1 + f(root->left) + f(root->right);
}
📄 中央113
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch5 樹狀結構
本章題號 · 41–48 / 48