文件名称:shujujiegou-erchashu
介绍说明--下载内容来自于网络,使用问题请自行百度
叉排序树与平衡二叉排序树基本操作的实现
用二叉链表作存储结构
(1)以回车( \\n )为输入结束标志,输入数列L,生成二叉排序树T;
(2)对二叉排序树T作中序遍历,输出结果;
(3)计算二叉排序树T的平均查找长度,输出结果;
(4)输入元素x,查找二叉排序树T,若存在含x的结点,则删除该结
点,并作中序遍历(执行操作2);否则输出信息“无结点x”;
(5)判断二叉排序树T是否为平衡二叉树,输出信息“OK!”/“NO!”;-fork trees and balanced binary tree order to achieve the basic operation of the binary tree used for the storage structure (1), carriage return ( \\ n) to mark the end of the importation, importation of L series, generate binary tree Sort T; (2) Ranking of two forks to make the tree T preorder, and the output results; (3) Calculations binary tree T ranking on the average search length, output; (4) Input elements x, find two tree fork Sort T, if x exists with the node, then remove the nodes, and make the preorder (execution 2); Otherwise output "node x"; (5) to determine the order of two trees T fork whether balanced binary tree, and the output message "OK!" / "NO!" ;
用二叉链表作存储结构
(1)以回车( \\n )为输入结束标志,输入数列L,生成二叉排序树T;
(2)对二叉排序树T作中序遍历,输出结果;
(3)计算二叉排序树T的平均查找长度,输出结果;
(4)输入元素x,查找二叉排序树T,若存在含x的结点,则删除该结
点,并作中序遍历(执行操作2);否则输出信息“无结点x”;
(5)判断二叉排序树T是否为平衡二叉树,输出信息“OK!”/“NO!”;-fork trees and balanced binary tree order to achieve the basic operation of the binary tree used for the storage structure (1), carriage return ( \\ n) to mark the end of the importation, importation of L series, generate binary tree Sort T; (2) Ranking of two forks to make the tree T preorder, and the output results; (3) Calculations binary tree T ranking on the average search length, output; (4) Input elements x, find two tree fork Sort T, if x exists with the node, then remove the nodes, and make the preorder (execution 2); Otherwise output "node x"; (5) to determine the order of two trees T fork whether balanced binary tree, and the output message "OK!" / "NO!" ;
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shujujiegou-erchashu.C
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.