斐波那契数列的定义:fib(n) = fib(n-1)+fib(n-2),同时也是其计算方法,当然需要指定其初始值。
1. 树的递归定义
对于树这样的数据结构,其左右孩子分别是一棵子树(形式同树完全相同,只是规模略小),以左式堆为例进行说明:
// leftheap.h
typedef int ElementType;
struct TreeNode;
typedef struct TreeNode* PriorityQueue;
// leftheap.c
struct TreeNode {
ElementType Element;
PriorityQueue Left;
PriorityQueue Right;
int Npl;
};