该题目答案,插入的时候可能因为顺序如(2,2)左右子树导致方向互换,【默认直接头插】问题而导致错位
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int number;
char value;
struct Leaf *left, *right;
struct Leaf *next;
} Leaf;
int fun(int x) {
if (x == 0) {
return 0; }
if (x == 1) {
return 1; }
return fun(x - 1) + fun(x - 2);
}
Leaf *produceNode(char loop) {
Leaf *front = malloc(sizeof(Leaf));
Leaf