![](https://img-blog.csdnimg.cn/2020102720560399.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据结构
放假偷的懒,都是考研的泪
头秃预备队队员
Python大法好
展开
-
折半查找顺序查找
#include<stdio.h>#define N 100typedef struct { int data[N]; int length;}SSTable;int zbcz(SSTable s,int k, int *p){ int n=0; int low,high,mid; low=1; high=s.length; while(low<=high) { n++; mid=(low+high)/2; if(s.data[mid]==k)原创 2020-11-03 02:30:36 · 82 阅读 · 0 评论 -
图
main.cpp#include <iostream>#include "GraphMtx.h"using namespace std;int main(){ GraphMtx gm; InitGraph(&gm); //插入顶点 InsertVertex(&gm,'A'); InsertVertex(&gm,'B'); InsertVertex(&gm,'C'); InsertVertex(&a原创 2020-11-01 00:54:02 · 131 阅读 · 0 评论 -
树
我不太懂这个,忘干净了—_—,只有代码,运行是对的main.cpp#include <iostream>#include "BinTree.h"using namespace std;int main(){ BinTree mytree; InitBinTree(&mytree,'#'); BinNode *p; printf("按照先序序列构建二叉树,例如:ABC##DE##F##G#H##\n"); CreateBinTree(原创 2020-10-30 21:57:39 · 183 阅读 · 0 评论 -
栈
main.cpp#include <iostream>#include"head.h"using namespace std;int main(){ SeqStack s; InitStack(&s); ElemType Item; ElemType *v; SeqStack st; InitStack(&st); int select=1; while(select) { print原创 2020-10-29 22:33:07 · 181 阅读 · 0 评论 -
单链表
main.cpp#include <iostream>#include "SList.h"using namespace std;int main(){ LinkList mylist; InitLinkList(&mylist); ElemType Item; LNode *p; int pos; int select =1; while(select) { printf("*********原创 2020-10-28 17:01:09 · 238 阅读 · 0 评论 -
C语言顺序表
head和source文件名是乱取的,可别这样main.cpp#include <iostream>#include"wqdhead.h"using namespace std;int main(){ SeqList mylist; InitSeqList(&mylist); SeqList mylist2; InitSeqList(&mylist2); int pos; ElemType Item; int selec原创 2020-10-27 23:15:07 · 358 阅读 · 0 评论