摘要: InitList(&L):初始化表。构造一个空的线性表 Length(L):求表长。返回线性表L 的长度,即L中数据元素的个数 LocateElem(L.e):按值查找操作。在表L中查找具有给定关键字值的元素 GetElem(L,i):按位查找操作。获取表L中第i个位置上的元素的值 ListInse 阅读全文
posted @ 2020-04-12 21:12 iiiiiki 阅读(632) 评论(0) 推荐(0)
摘要: 语法 for (语句1; 语句2; 语句3) { 被执行的代码块 } 语句 1 在循环(代码块)开始前执行 语句 2 定义运行循环(代码块)的条件 语句 3 在循环(代码块)已被执行之后执行(这就是循环中的++i和i++结果一样的原因,但是性能不一样,稍后解释) 语句1 (同上面语法中的 语句1) 阅读全文
posted @ 2020-04-11 21:19 iiiiiki 阅读(990) 评论(0) 推荐(0)
摘要: #include<stdlib.h>#include<iostream>using namespace std;typedef struct IntChain{ int value;//存储具体值 struct IntChain *next;//用于寻找下一元素 }IntChain,*PIntCha 阅读全文
posted @ 2020-04-10 22:07 iiiiiki 阅读(386) 评论(0) 推荐(0)
摘要: 具体在DynamicArray 阅读全文
posted @ 2020-04-09 21:08 iiiiiki 阅读(120) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<stdlib.h>#include<malloc.h>//包含malloc函数的头文件 struct Item//定义结构体{ char name[20]; int num; }; struct Item *I;//申请Item类型的指针 int 阅读全文
posted @ 2020-04-08 22:01 iiiiiki 阅读(218) 评论(0) 推荐(0)
摘要: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef: typedef struct Student { int a; }Stu; 于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明) 这里的Stu实 阅读全文
posted @ 2020-04-08 21:40 iiiiiki 阅读(164) 评论(0) 推荐(0)