![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
垆边人似月
人生道路上
感谢每一个走了的人
期待每一个到来的人
珍惜每一个身边的人
展开
-
单链表(头指针)
#include #include //malloc的头文件 #define OK 0 #define ERROR -1 #define MALLOC_ERROR -2 typedef int ElementType; typedef struct node { ElementType data; //结原创 2017-08-04 20:24:14 · 699 阅读 · 0 评论 -
单链表(表头结点)
#include #include #define OK 0 #define ERROR -1 #define MALLOC_ERROR -2 typedef int ElementType; //c语言中没有ElementType这个数据类型,讲数据结构时,用这个来泛指某一种数据类型 typedef struct node {原创 2017-08-04 20:38:35 · 1574 阅读 · 0 评论 -
快速排序
#include void quicksort(int a[],int left,int right) { int i,j; if(left < right) { i = left; //left、right用于限定要排序数列的范围,temp即为中心元素 j = right; int temp = a[l原创 2017-08-05 18:59:50 · 245 阅读 · 0 评论 -
归并排序
归并排序(MERGE-SORT)是建立在归并操作上的一种有效的排序算法,该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。将已 有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为二路归并。 归并过程为:比较a[i]和b[j]的大小,若a[i]≤b[j],则将第一个有序表中的元素a[i]复制到r[k]原创 2017-08-05 19:03:06 · 287 阅读 · 0 评论 -
基数排序
#include #include int getlooptimes(int num) { int count = 1; int temp = num/10; while(temp!=0) { count++; temp = temp/10; } return count; } int findmaxnum(int *p,int n) { int i; int max原创 2017-08-05 19:03:47 · 272 阅读 · 0 评论