动态查找表(二叉排序树)

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

北京理工大学珠海学院计算机学院课程设计

动态查找表

摘要

数据结构是研究与数据之间的关系我们称这一关系为数据的逻辑结构简

称数据结构。当数据的逻辑结构确定以后数据在物理空间中的存储方式称为数据的存储结构。相同的逻辑结构可以具有不同的存储结构因而有不同的算法。本次课程设计程序中的数据采用“树形结构”作为其数据结构。具体采用

的是“二叉排序树”并且使用“二叉链表”来作为其存储结构。本课程设计实现了二叉排序树的创建、中序遍历、插入、查找和删除二叉排序树中某个结点。本课程主要实现动态查找表的功能通过“二叉排序树”的算法和“二叉链

表”的存储结构来实现。本课程设计说明书重点介绍了系统的设计思路、总体设计、各个功能模块的设计与实现方法。

关键词数据结构 C语言二叉排序树动态二叉链表

1

2

目录

摘要 (1)

1ABSTRACT (3)

2

3抽象数据类型动态查找表定义 (4)

4

3 系统总体分析 (5)

3.1系统模块划分 (5)

3.2 二叉树的生成过程 (5)

3.3 主要功能模块设计 (5)

3.4 系统详细设计 (7)

3.4.1 主函数菜单模块 (7)

3.4.2 查找模块 (10)

3.4.3 删除模块 (11)

3.4.4 插入模块 (13)

3.4.5 中序输出模块 (15)

参考文献 (17)

心得体会 (18)

教师评语 (19)

附录 (20)

2

1 Abstract(摘要)

Data structure is the relationship between research and data, we call

this relationship as a logical data structure, referred to as data

structures. When the data logical structure is determined, the data stored

in the physical space, is known as the data storage structure. The same

logical structure can have different storage structure, which has a

different algorithm.

The curriculum design, program data is "tree" as its data structure.

Specific uses "binary sort tree" and use "binary list" as its storage

structure. The course is designed to achieve a binary sort tree creation,

in-order traversal, insert, find and delete a binary sort tree nodes.

This course is mainly the function of dynamic look-up table, through

the "binary search tree" algorithm and "binary list" of storage structures.

This course is designed to highlight the system design concept, overall

design, each functional module design and implementation.

Keywords: C Language Data Structure Dynamic Binary Search Tree,

Binary List

3

2 抽象数据类型动态查找表定义

ADT DynamicSearchTable{

数据对象D D是具有相同特性的数据元素的集合。各个数据元素含有类型相同

可唯一标识数据元素的关键字。

数据关系R:数据元素同属一个集合。

基本操作P

InitDSTable(&DT);

操作结果构造一个空的动态查找表DT。

DestroyDSTable&DT;

初始条件动态查找表DT存在。

操作结果销毁动态查找表DT。

SearchDSTable DT key;

初始条件动态查找表DT存在key为和关键字类型相同的给定值。

操作结果若DT中存在其关键字等于key的数据元素则函数值为该元素的

值或在表中的位置否则为“空”。

InsertDSTable&DT e;

初始条件动态查找表DT存在e为待插入的数据元素。

操作结果若DT中不存在其关键字等于e的数据元素则插入e到DT。DeleteDSTable&DT key;

初始条件动态查找表DT存在key为和关键字类型相同的给定值。

操作结果若DT中存在其关键字等于key的数据元素则删除之。

InOrderTraverse(DT);

初始条件动态查找表DT存在。

操作结果按中序的次序输出DT中的每个结点数据值。

}ADT DynamisSearchTable

4

相关文档
最新文档