数据结构
放假偷的懒,都是考研的泪
头秃预备队队员
Python大法好
展开
-
折半查找顺序查找
#include<stdio.h> #define N 100 typedef 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 · 79 阅读 · 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 · 123 阅读 · 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 · 174 阅读 · 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 · 179 阅读 · 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 · 233 阅读 · 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 · 350 阅读 · 0 评论