自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

转载 那些优雅的数据结构(1) : BloomFilter——大规模数据处理利器

Repost From:  http://www.cnblogs.com/heaad/archive/2011/01/02/1924195.html 本文是我一个雄心勃勃的写作计划的开始:1.Bloom Filter2.线段树3.树状数组4

2011-10-05 22:18:36 364

原创 生成全排列、非全排列、组合

#include  --- --- --- --- --- --- 生成全排列(递归) --- --- --- --- --- ---参数解释:s[]:需要生成排列的数组,m:起始下标,n:结束下标--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---void perm(int s[],int m,in

2009-10-17 11:22:00 747

转载 求最大、最小值的高效算法

void MaxMin(int a[], int n){    int max,min,s,i; //s为循环起始元素的下标    if (n     if (n == 1) max = min = 0;    else    {           //n为奇数时,max和min初值为第0个元素        if (n%2) {max = min = 0; s

2009-10-16 18:23:00 1626

原创 二叉搜索树的查找、插入、删除

#include #include  struct node    //节点的数据结构{     int data;     struct node *left;     struct node *right; };  --- --- --- --- --- --- --- 查 找 --- --- --- --- --- --- ---void BST

2009-10-16 18:20:00 608

原创 最大堆的插入、删除、初始化

#include int CurrSize,MaxSize; //以下均假设数组第0个元素不使用--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---插入:先插到最后面,然后循环地与父节点比较,在这个过程中把元素一层层下移,直到找到合适的位置插入 --- --- --- --- --- --- ---

2009-10-16 18:17:00 2583 1

原创 有序单向链表的相关操作

#include #include struct node    //节点的数据结构{     int num;     struct node *next; }; --- --- --- --- --- --- --- 插 入 --- --- --- --- --- --- ---struct node *insert_node(struct node *hea

2009-10-16 18:14:00 417

原创 二叉树相关操作

#include #include  struct node    //节点的数据结构{     int data;     struct node *left;     struct node *right; }; --- --- --- --- --- ---  前 序 遍 历  --- --- --- --- --- ---void PreOrder

2009-10-16 18:07:00 404

转载 最大公约数

int gcd(int m, int n) {     int rem;     while(n != 0)     {         rem = m % n;         m = n;         n = rem;     }     return m; }  void main() {  printf("%d/n",gcd(8, 1

2009-10-16 18:05:00 356

转载 折半查找 (二分查找)

int binarySearch(int s[], int n, int x) {     int low = 0, high = n-1;     while(low     {         int mid = (low + high) / 2;         if(s[mid]        low = mid + 1;         else if(s[m

2009-10-16 17:55:00 505

原创 打印斐波那契数列

--- --- --- --- --- --- ( 循环 ) --- --- --- --- --- --- void FSum(int n){    int a = 0,b = 1,sum,i;    if (n >= 1)    {    sum = a;  printf("%d ",sum);    }       if (n >= 2)    {    sum = b;

2009-10-16 17:45:00 519

原创 生成一个整数集合的所有子集

void subset(int s[],int f[],int m,int n){    int i;    f[m] = 0;  //标记该元素出现    if (m == n)    {   printf("{");        for(i = 0; i           {            if (f[i] == 0) printf("  ");

2009-10-16 17:39:00 578

原创 5种基本排序法

#include     --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---计数排序:                                                      a[i]与后面的每个元素相比,若a[i]较大则Count[i]+1,否则对方+1      --- --- -

2009-10-16 17:08:00 429

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除