![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
点西西
新手渣渣的学习笔记,望各路大神多多指点。
展开
-
算法
查找算法 顺序表查找 int Sequential_search(int *a, int n, int key) { int i; for (i = 1; i <= n; i++) { if (a[i] == key) return i; } return 0; } 优化: int Sequential_search2(int *a, int n, int key) { int i; a[0] = key; i = n; while (a[i] != key) {原创 2020-09-10 17:32:05 · 103 阅读 · 0 评论 -
数据结构基本结构
线性表 线性表的顺序存储结构 # define OK 1 # define ERROR 0 # define TRUE 1 # define FALSE 0 typedef int Status; # define MAXSIZE 20 typedef int ElemType; typedef struct { ElemType data[MAXSIZE]; int length; }SqList; //获得元素 Status GetElem(SqList L, int i, ElemType原创 2020-08-31 17:16:31 · 215 阅读 · 0 评论