• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
莫小鹏
博客园 首页 新随笔 联系 订阅 订阅 管理

随笔分类 -  C语言

 
hash表C语言实现
摘要:算法参考《算法导论》第11章散列表。采用链地址法解决冲突.#include #include #include #include /*通过链接法解决碰撞*/typedef const char* hash_key_type;typedef int hash_value_type;typedef in... 阅读全文
posted @ 2015-11-08 21:43 莫小鹏 阅读(771) 评论(0) 推荐(1)
C语言实现栈
摘要:#include #include #include typedef struct stack_tag{ int top; int num; int *data;} stack;stack * stack_init(int num){ stack *s = (stack*)m... 阅读全文
posted @ 2015-10-26 21:06 莫小鹏 阅读(205) 评论(0) 推荐(0)
大数加法
摘要:#include #include #include #include void reverse_str(char *pBegin, char *pEnd){ while(pBegin = 0 || j >= 0)); i--, j--, k++){ int a = i >= 0... 阅读全文
posted @ 2015-10-21 13:49 莫小鹏 阅读(238) 评论(0) 推荐(0)
kmp算法
摘要:#include #include #include int kmp(const char *str, const char *str_sub){ int sub_len = strlen(str_sub); if(sub_len == 0){ return 0; ... 阅读全文
posted @ 2015-10-13 14:05 莫小鹏 阅读(168) 评论(0) 推荐(0)
最大堆
摘要:根据《算法导论》中介绍的算法实现。 #include #include #include typedef struct priority_queue_tag { int heap_size; int *array;} priority_queue;int parent(int i... 阅读全文
posted @ 2015-10-06 19:53 莫小鹏 阅读(280) 评论(0) 推荐(0)
C语言实现快排
摘要:#include void swap(int *pa, int *pb){ int t = *pa; *pa = *pb; *pb = t;}int partion(int *array, int begin, int end){ if (array == NULL || b... 阅读全文
posted @ 2015-09-30 17:58 莫小鹏 阅读(598) 评论(0) 推荐(0)
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3