資料結構›Ch5 樹狀結構第 7 題/共 48 題
7. Binary Tree、遞迴、葉節點計數
#DS-05-007易Binary Tree遞迴葉節點計數
Write a function in pseudocode to calculate the number of leaf nodes of a binary tree. A node in a binary tree has two pointers, named 'left' and 'right', where the 'left' pointer is used to find the left child of the node and the 'right' pointer is used to find the right child. Your function will take a node as the input and return an integer representing the number of leaf nodes in the tree rooted at that node.
📄 台大114
▤完整推導請見《WH 資工筆記 · 資料結構》Ch5 樹狀結構