搜索资源列表
shujujiegou-erchashu
- 叉排序树与平衡二叉排序树基本操作的实现 用二叉链表作存储结构 (1)以回车( \\n )为输入结束标志,输入数列L,生成二叉排序树T; (2)对二叉排序树T作中序遍历,输出结果; (3)计算二叉排序树T的平均查找长度,输出结果; (4)输入元素x,查找二叉排序树T,若存在含x的结点,则删除该结 点,并作中序遍历(执行操作2);否则输出信息“无结点x”; (5)判断二叉排序树T是否为平衡二叉树,输出信息“OK!”/“NO!”;-fork trees and
b
- 已知一个双向链表,从第二个元素开始已经呈递增有序,请编写一个算法把第一个元素删除且插入到适当位置,结果链表仍然有序(设表无头结点) 主要是定义一个双向链表,随意输入几个数字,把第一个数字插进去,条件的是呈递增有序,把第一个元素删除! -Known to a two-way list, from the beginning of the second element has been increasing in an orderly manner, write an algorithm
a
- 有双向循环链表结点定义为: struct node { int data struct node *front,*next } 有两个双向循环链表A,B,知道其头指针为:pHeadA,pHeadB,请写一函数将两链表中data值相同的结点删除,并测试。-Two-way linked list node cycle defined as: struct node (int data struct node* front,* next ) there are two t
danlianbiao
- 单向链表的有关操作 1.随机产生或键盘输入一组元素,建立一个带头结点的单向链表(无序)。 2.遍历单向链表。 3.把单向链表中元素逆置(不允许申请新的结点空间)。 4.在单向链表中删除所有的偶数元素结点。 实验说明: 为了算法实现简单,最好采用带头结点的单向链表。 -One-way linked list of the operation
Joseph
- 编号为1,2,3,…,n的n个人按顺序针方向围坐一张圆桌旁,每个人手中持有 一个密码(正整数)。首先输入一个正整数作为报数上限值m,然后,从第一个人开始按顺序针方向自1开始顺序报数,报到m的人离开桌子,并将他手中的密码作为新的m值,从顺序针方向的下一个就坐在桌旁的人开始重新从1报数,如此下去,直至所有人全部离开桌旁为止。 算法思想: 用单循环链表来解决这一问题,实现的方法首先要定义链表结点,单循环链表的结点结构与一般单链表的结点结构完全相同,只是数据域用一个整数来表示;然后将它们组成
double-way-link-list
- 建立带头结点的双向循环链表L,插入,删除,逆置-double-way linked-list representation and implementation
77885
- 程序产生N个随机的整数,存放在数组a中。然后根据数组a建立线性链表, 再删除链表中所有重复元素,并输出无重复元素结点的链表结点的值 -Program generates a random integer N, stored in the array a. Then establish a linear list of the array,     Then delete all duplicate elements in the list, and output
1_2
- 用c语言建立带表头结点的链表,并在主函数里面实现链表的建立,按值查询,前插,删除,输出-Established by c language list with a header node, and to achieve the establishment of the list in the main function of which, according to the value of the query, forward runs, delete, output
数据结构城市链表
- 1. 城市链表 [问题描述] 将若干城市的信息,存入一个带头结点的单链表。结点中的城市信息包括:城市名,城市的位置坐标。要求能够利用城市名和位置坐标进行有关查找、插入、删除、更新等操作。 [基本要求] (1) 给定一个城市名,返回其位置坐标; (2) 给定一个位置坐标P和一个距离D,返回所有与P的距离小于等于D的城市。(1. City chain list [descr iption of the problem] The information of a number