| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 676 人关注过本帖
标题:[求助]一道关于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
快速回复:[求助]一道关于2叉树的题目,大虾们帮帮我
数据加载中...
 
   



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

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