算法
putaoxiangqi
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
利用K-堆求最大的K个数
1.原理: 将数据存在数组中,利用堆排排序数组的前K个数原创 2014-06-24 15:08:20 · 489 阅读 · 0 评论 -
编程珠玑:插入排序的最优探索,以及快排
打扑克的时候选取的排序方法就是插入排序。 1.1 for(i=)原创 2014-07-13 18:30:17 · 526 阅读 · 0 评论 -
堆排
建立大堆,输出递减排序 #include void swap(int *a,int *b) { int * c=0; *c=*a; *a=*b; *b=*c; } void adjustHeap(int arr[],int n,int i) { int j; int temp=arr[i]; j=2*i+原创 2014-06-18 15:03:43 · 583 阅读 · 0 评论 -
二叉排序树的删除和查找
二叉排序树的删除和查找原创 2014-06-17 13:47:56 · 496 阅读 · 0 评论 -
二分查找(折半查找)
#include int dinarysearch(int arr[],int left,int right,int value) { int middle=(left+right)/2; if(left>right) return -1; if(value>arr[middle]) return dinarysearch(arr原创 2014-06-16 16:34:10 · 367 阅读 · 0 评论 -
二叉排序树-动态查找表
#include #include typedef struct node { int element; struct node* left; struct node* right; }Node,*NodePtr; int arr[]={1,2,4,12,6,44,23}; static int num=0; void insertNode(NodePtr *head,in原创 2014-06-17 09:06:01 · 574 阅读 · 0 评论 -
最大值
#include void shift(int arr[],int n,int i) { int j=2*i+1; int temp=arr[i]; while(j { if(j+1 ++j; if(arr[j] break; arr[i]=ar原创 2014-06-23 14:32:10 · 387 阅读 · 0 评论 -
中缀表达式变成后缀表达式
aahah原创 2016-07-22 16:05:35 · 440 阅读 · 0 评论
分享