标题:[求助]一道关于2叉树的题目,大虾们帮帮我
只看楼主
uu2008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-12-14
 问题点数:0 回复次数:0 
[求助]一道关于2叉树的题目,大虾们帮帮我

原题如下:

(1) Prove that for any nonempty binary tree, n0 = n2 + 1 where n0 is the number of leaf nodes and n2 the number of nodes of degree 2.

(2) Using linked representation following to create a binary tree. The program you implemented should accept the data to ‘data’ field from input.

typedef struct node *tree_ptr;

typedef struct node

{

int data;

tree_ptr left_child,right_child;

}

Implement the program of inorder traversal, preorder traversal and postorder traversal. And analyze their time complexity.

(3) Consider a message comprised only of the following symbols: {C, A, T, P}, assume message is: CCT PAT TTP CTP CPA, use the Huffman algorithm to encode the symbols by frequency.Implement the program to create this tree.

滴水之恩 当泉涌相报

搜索更多相关主题的帖子: tree 
2005-12-14 23:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-38217-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.432071 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved