
数据结构和算法
逐梦如风
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c的链表
头文件 ` #ifndef LIST_H #define LIST_H#include <stdlib.h>//定义基础的结构typedef struct ListElmt_{ void *data; struct ListElmt_ *next;}ListElmt;//定义列表typedef struct list_{ int size;//大小原创 2016-09-10 21:36:47 · 1742 阅读 · 0 评论 -
AVL树
AVL树的特征1 AVL树 仍然是 左 子 结点 小于 父 结点, 父 结点 小于 右 子 结点2 AVL树 AVL 树( Adel' son- Vel' skii and Landis) 是一 种 特殊 类型 的 二 叉 树, 它的 每个 结点 都 保存 一份 额外 的 信息: 结点 的 平衡 因子。3 AVL 树 需要 自我 调整, 使得 所有 结点 的 平衡 因子 保持 为+ 1、-原创 2016-09-29 17:48:33 · 972 阅读 · 0 评论 -
二叉树的遍历
读下面的内容需要了解以下两方面的代码1 关于二叉树的定义2 链表的实现头文件//// traverse.h// tree//// Created by bikang on 16/9/26.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __tree__traverse__#define __tree__t原创 2016-09-26 14:24:32 · 552 阅读 · 0 评论 -
二叉树的实现
头文件//// tree.h// tree//// Created by bikang on 16/9/26.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __tree__tree__#define __tree__tree__#include <stdlib.h>//#include <stdio原创 2016-09-26 11:40:18 · 1111 阅读 · 0 评论 -
链式哈希表
将数据存储在桶中-桶是链表。如果冲突,增大链表长度需要用到我的链表头文件//// cntbl.h// hash//// Created by bikang on 16/9/22.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __hash__cntbl__#define __hash__cntbl__#i原创 2016-09-22 14:12:22 · 1290 阅读 · 0 评论 -
哈希
哈希哈希冲突解决办法链式哈希表将数据存储在桶中-桶是链表。如果冲突,增大链表长度开发地址哈希表数据本身存储在链表中,通过探测避免冲突哈希方法的目的将键均匀,随机分布到表中的哈希函数1 取余法,选择因子 k mod m2 乘法 m*(k*a mod 1)--0<a<1开放地址hasha = n/m a2 = 1/(1-a)哈希负载因子,均匀分布程度h(k,i) = x (0<i<m-原创 2016-09-23 17:21:55 · 909 阅读 · 0 评论 -
开发地址哈希
头文件//// ohash.h// ohash//// Created by bikang on 16/9/23.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __ohash__ohash__#define __ohash__ohash__#include <stdlib.h>typedef struc原创 2016-09-23 17:20:05 · 999 阅读 · 0 评论 -
git的简单使用
git的简单使用在这个过程中我们可以使用 git status 来查看代码的版本 git log 来查看日志下载一个远程项目 git clone https://github.com/beckbikang/BlogProject.git创建一个本地的分支 cd BlogProject/ git branch 查看分支情况 git checkou原创 2016-09-23 14:26:06 · 392 阅读 · 0 评论 -
双向循环队列
相信有了前面的基础我们可以很容易的实现单向循环队列需要引入我的链表的list.c和list.h头文件//// double_queue.h// double_queue//// Created by bikang on 16/9/12.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __double_que原创 2016-09-18 14:37:12 · 2292 阅读 · 0 评论 -
c实现set集合
集合有点编程语言会带有,有的没有。但是我想redis的集合set你一定听说过或者用过。下面咱们用链表来实现set相信有了前面的基础我们可以很容易的实现set集合需要引入我的链表的list.c和list.h头文件//// set.h// set//// Created by bikang on 16/9/18.// Copyright (c) 2016年 bikang. All ri原创 2016-09-19 11:55:21 · 11157 阅读 · 1 评论 -
单向循环队列
相信有了前面的基础我们可以很容易的实现单向循环队列需要引入我的链表的list.c和list.h头文件//// cycle_queue.h// cycle_queue//// Created by bikang on 16/9/12.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __cycle_queue_原创 2016-09-17 19:55:51 · 1224 阅读 · 1 评论 -
队列的链表实现
相信有了前面的基础我们可以很容易的实现队列需要引入我的链表的list.c和list.h头文件//// queue.h// queue//// Created by bikang on 16/9/9.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __queue__queue__#define __queu原创 2016-09-16 16:59:07 · 745 阅读 · 0 评论 -
栈的链表实现
相信有了前面的基础我们可以很容易的实现栈需要引入我的链表的list.c和list.h头文件//// stack.h// stack//// Created by bikang on 16/9/9.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __stack__stack__#define __stack原创 2016-09-15 19:55:24 · 811 阅读 · 0 评论 -
双向循环链表
头文件//// c_double_list.h// cycle_doublelist//// Created by bikang on 16/9/1.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __cycle_doublelist__c_double_list__#define __cycle_dou原创 2016-09-13 17:13:34 · 640 阅读 · 0 评论 -
循环单链表
头文件//// clist.h// cycle_list//// Created by bikang on 16/9/1.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __cycle_list__clist__#define __cycle_list__clist__//定义基础的结构typedef原创 2016-09-12 17:56:44 · 548 阅读 · 0 评论 -
c的双向链表
头文件//// double_list.h// doublelist//// Created by bikang on 16/8/29.// Copyright (c) 2016年 bikang. All rights reserved.//#ifndef __doublelist__double_list__#define __doublelist__double_list_原创 2016-09-11 18:13:15 · 696 阅读 · 0 评论 -
java实现队列和循环队列
这个问题以前没有注意,现在觉得很有趣。1 普通队列,在数据里面加一个size来判断数据总量的大小,再根据大小判断是否空和满,empty和full我未写到方法里面。每次都需要额外对size进行操作,高性能场景还是有部分性能损失。front指向可用的元素,rear指向下一个可用的元素。class QueueS{ private int max; private l...原创 2018-03-19 23:34:18 · 879 阅读 · 0 评论