07 2020 档案

摘要:二分法查找(选择排序) 源程序: #include <stdio.h>#define MaxSize 8typedef struct{ int stuno; char stuname[20];}TableElem; TableElem stu[]={{1009,"wang"},{4400,"ren" 阅读全文
posted @ 2020-07-20 16:05 bobo哥 阅读(198) 评论(0) 推荐(0) 编辑
摘要:顺序查找(通用算法) 源程序: #include <stdio.h>#define MaxSize 8typedef struct{ int stuno; char stuname[20];}TableElem; //基本分量结构体类型 TableElem stu[]={{1001,"zhang"} 阅读全文
posted @ 2020-07-20 15:47 bobo哥 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Hash函数的实现(线性探测法,除留余数法) 源程序: #include <iostream>#include <stdlib.h>#include <stdio.h>#define HASHSIZE 12#define NULLKEY -1struct HashTable{ int *elem; 阅读全文
posted @ 2020-07-17 21:11 bobo哥 阅读(117) 评论(0) 推荐(0) 编辑
摘要:二叉排序树 源程序: #include "stdio.h"#include "stdlib.h" typedef struct tnode{ int id; int score; struct tnode *lchild,*rchild;}stu;void Ins_Student(stu **p,l 阅读全文
posted @ 2020-07-17 12:52 bobo哥 阅读(133) 评论(0) 推荐(0) 编辑
摘要:无向图的邻接表存储方法 源程序: #include <stdio.h>#include <stdlib.h>#define VNUM 100 //顶点的类型typedef char VerType;typedef struct arcnode{ int adjvex; //下一条边的顶点编号 str 阅读全文
posted @ 2020-07-12 16:12 bobo哥 阅读(146) 评论(0) 推荐(0) 编辑
摘要:图的带权邻接矩阵存储 源程序: #include <stdio.h>#include <stdlib.h>#define VNUM 20const int MAX_INT=0; //图的类型定义typedef struct gp{ char vexs[VNUM]; int arcs[VNUM][VN 阅读全文
posted @ 2020-07-12 16:07 bobo哥 阅读(239) 评论(0) 推荐(0) 编辑
摘要:图的邻接矩阵存储 源程序 #include <stdio.h>#include <stdlib.h> const int vnum=20; //定义图的类型typedef struct gp{ char verx[vnum]; int arcs[vnum][vnum]; int vernum,arc 阅读全文
posted @ 2020-07-12 16:01 bobo哥 阅读(143) 评论(0) 推荐(0) 编辑
摘要:二叉树操作 左右子树交换后的二叉树 //二叉树的实现#include <iostream>using namespace std;//二叉树的结点定义typedef struct bitreenode{ char data; struct bitreenode *lchild,*rchild;}*B 阅读全文
posted @ 2020-07-05 16:34 bobo哥 阅读(157) 评论(0) 推荐(0) 编辑