Summary [Data Structure] list associated with the operation of all connections

A. Notes

Understand the basic concepts of linear table (logical properties, and physical storage term)

1. Basic Concepts

Finite sequence of n (n> = 0) identical data is referred to as linear characteristic elements table

2. logical properties

It exists only one is referred to as the "first" data element

Exists only one is referred to as the "last" data element

Except the first one, the structure of each element is only a precursor

Except the last addition, the structure of each element has only one rear drive

3. Terminology

4. Physical storage

A contiguous memory address -> sequence table

May be non-contiguous storage address -> chain

B. branched chain associated connecting thin

Note: all through the gcc compiler.

Merge the sorted list

Univariate polynomial representation and adding

Its basic operation circular list

Its basic operation cycle table

Two-way circular list and its basic operation

Doubly linked list and its basic operation

Single chain and its basic operation

C. Writing log

1
ypedef是类型定义的意思。typedef struct 是为了使用这个结构体方便。
若struct node{ }这样来定义结构体的话。在定义 node 的结构体变量时,需要这样写:struct node n; 
若用typedef,可以这样写:typedef struct node{}NODE; 。在申请变量时就可以这样写:NODE n;其实就相当于 NODE 是node 的别名。区别就在于使用时,是否可以省去struct这个关键字。

2
线性表与链表中多存在的&符号 是为了给外部变量赋值 直接给到外部的地址中!

3
单链表排序部分出错 冒泡出问题
已改为选择排序 成功

4
*LinkList 其实从始至终都是拿来指向自己的

在这里修改是直接修改的 LIST本身!

*date 可以表示为直接申请一个数组空间

5
双向链表过程中
漏看了 P40 的 if(!(p=GetElem_Dul(L,i))) 内的L
且书中缺少该模块

在 InsertDulList 中 p 出现内存错误
因此发现 返回为 指针属性

依据经验增添 GetElemDulList 如下
DulList* GetElemDulList(DulLinkList &L, int i)
{
	DulList *p = L;
	int j = 0;

	while (p && j < i)
	{
		p = p->next;
		++j;
	}

	if (i<1 || j>i)
		;

	return p;
}

p->prior 出现内存错误
依据经验添加 CreatDulList_H 模块

P 持续在 InsertDulList 出现内存错误
推断为 GetElemDulList 中 指针p 移动到了 NULL
更改 while (p && j < i)
无效

排查后发现是 CreatDulList_H 中 prior 的缺失

尴尬 巨尴尬

6
循环链表 看了半天都不知道哪里有
看了看说尾巴指向头

然后我就试了一下 在 遍历 部分 把尾巴指向头 如下:

	LNode *q = L->next;
	while(q->next)
	{
		q = q->next;
	}
	q->next = L->next; 

然后就好像成功了... 可以说是极快了...

7
有序表的合并部分 
不得不吐槽一下
这他妈?
书上的代码是垃圾吗?
啊 重要是理解算法思维自己做
关键是你写的太繁杂 不如自己写啊喂
MMP 开玩笑吧 我们这个学校的老师教学也跟开玩笑一样
天大的玩笑哦
存在部分问题 

8
一元多项式的表示与相加
哇 真实 
书上写的这么多 
说白了 也就一点点东西
MMP 这部分该老师教的 我教了尼玛个锤子
P48的 P3 不知道应该是指向那里的 
后来想了想 *p3 = Pa;
对了 
笑死我了

7.2
改完了 我看指针下意识以为是结点
重新写了一遍 半途发现是尼玛的ELEM*指针
赣

Published 70 original articles · won praise 8 · views 1256

Guess you like

Origin blog.csdn.net/weixin_43910320/article/details/104740914