
数据结构
千年的塔
Go语言和MySQL技术专家,著有《Go语言核心编程》一书。
展开
-
交换排序 --C语言数据结构
#include #include void swap(int *p1,int *p2);void bubble_sort(int *a,int n);/*函数功能:使用交换法进行排序:从小到大; 函数原型:void swap_sort(int *a,int n) 函数参数:int *a:数组名 int n :排序元素数 函数返回值:void 作者 : 李文塔 Wen原创 2008-08-20 09:51:00 · 1213 阅读 · 0 评论 -
快速排序----C语言数据结构
#include #include void swap(int *p1,int *p2);void quick_sort(int *a,int left,int right);/*函数功能:使用快速排序法进行排序:从小到大; 函数原型:void quick_sort(int *a,int left,int right) 函数参数:int *a:数组名 int left:排原创 2008-08-20 09:37:00 · 2681 阅读 · 0 评论 -
冒泡排序 C数据结构
#include #include void swap(int *p1,int *p2);void bubble_sort(int *a,int n);/*函数功能:使用冒泡法进行排序:从小到大; 函数原型:void bubble_sort(int *a,int n) 函数参数:int *a:数组名 int n :排序元素数 函数返回值:void 作者 : 李文塔 W原创 2008-08-20 09:42:00 · 6298 阅读 · 0 评论 -
基数排序 C语言数据结构
#include #define N 10/*函数功能:求一个整数的第K位的值 函数原型:int digitk(int no,int k)函数参数:函数返回值:返回数据的位数 作者 : 李文塔 Wenta Li 日期: 2008年5月21日 11:19 */int digitk(int no,int k){ int i,j,m; if(k==0) { return no%10原创 2008-08-20 09:44:00 · 2332 阅读 · 4 评论 -
选择排序 --C语言数据结构
#include #include void swap(int *p1,int *p2);void select_sort(int *a,int n);/*函数功能:使用选择排序法进行排序:从小到大; 函数原型:void select_sort(int *a,int n) 函数参数:int *a:数组名 int n :排序元素数 函数返回值:void 作者 : 李文塔原创 2008-08-20 09:45:00 · 2398 阅读 · 4 评论 -
插入排序 --C数据结构
#include #include void swap(int *p1,int *p2);void insert_sort(int *a,int n);/*函数功能:使用插入法进行排序:从小到大; 函数原型:void insert_sort(int *a,int n) 函数参数:int *a:数组名 int n :排序元素数 函数返回值:void 作者 : 李文塔 W原创 2008-08-20 09:39:00 · 2214 阅读 · 0 评论 -
二叉树排序 --C语言数据结构
#include #include typedef struct btree{ int data; struct btree *left; struct btree *right; }BTR,*PBTR;typedef struct BTRSt{ PBTR ptree; struct BTRSt *link;}Stack,*PStack;PBTR Bitree=NULL;/*函数原创 2008-08-20 09:48:00 · 3420 阅读 · 0 评论 -
操作系统进程调度模拟程序 基于优先级调度和时间片轮转调度算法
/* 转载此贴请注明出处*/#include #include #include #include /*进程控制块数据结构*/typedef struct node { char name[10];/*进程名*/ int prio; /*进程优先级*/ int round; /*进程分配的时间片*/ int cputime; /*进程消耗的CUP时间*/ int need原创 2008-09-22 15:01:00 · 12248 阅读 · 1 评论