Description: 叉排序树与平衡二叉排序树基本操作的实现
用二叉链表作存储结构
(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!" ; Platform: |
Size: 2028 |
Author:胡图 |
Hits:
Description: 叉排序树与平衡二叉排序树基本操作的实现
用二叉链表作存储结构
(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!" ; Platform: |
Size: 2048 |
Author:胡图 |
Hits:
Description: 严蔚敏C语言版数据结构源代码 与书上的算法同步-YAN Wei-Min C language source code version of the data structure and algorithm book synchronization Platform: |
Size: 225280 |
Author:王慎 |
Hits:
Description: 实现对任意给定的二叉树(顶点数自定)建立它的二叉链表存贮结构,并利用栈的五种基本运算(置空栈、进栈、出栈、取栈顶元素、判栈空)实现二叉树的先序、中序、后序三种遍历,输出三种遍历的结果。-Any given realization of the binary tree (self-Vertices) the establishment of its chain store binary structure, and use the five basic computing stack (The stack space, into the stack, the stack, from Top-element contractors stack space) to achieve the first order binary tree, in order, after three traversal sequence, the output of the results of three kinds of traversal. Platform: |
Size: 44032 |
Author:大傻 |
Hits: