我可以给你一个例子: #include <stdio.h> struct node { int data; struct node left, right; }; / function to print leaf nodes of a binary tree/ void printLeaves(struct node* root) { if ( root != NULL ) { printLeaves(root->left);
// 如果节点为叶子节点,则打印
if ( root-
我可以给你一个例子: #include <stdio.h> struct node { int data; struct node left, right; }; / function to print leaf nodes of a binary tree/ void printLeaves(struct node* root) { if ( root != NULL ) { printLeaves(root->left);
// 如果节点为叶子节点,则打印
if ( root-