数据结构
文章平均质量分 80
王教余
码农
展开
-
查找树(二叉树)的构建以及分层遍历
代码均通过vs2008编译运行头文件代码:#include #include //包含stack和queue,为了方便遍历数据存储#include struct BTree//定义查找树的结构{ int m_data; struct BTree* m_pLeft; struct BTree* m_pRight;};struct BTre原创 2013-04-02 20:40:34 · 1162 阅读 · 2 评论 -
Bloom Filter的原理基本介绍
Bloom Filter概念和原理焦萌 2007年1月27日 Bloom Filter是一种空间效率很高的随机数据结构,它利用位数组很简洁地表示一个集合,并能判断一个元素是否属于这个集合。Bloom Filter的这种高效是有一定代价的:在判断一个元素是否属于某个集合时,有可能会把不属于这个集合的元素误认为属于这个集合(false positive)。因此,Bloom Filter转载 2013-04-05 15:36:41 · 821 阅读 · 0 评论 -
分离链接法实现哈希表
代码通过VS2008编译/* *@author : Fisher Wang *@function: Realize a hash table *@date : 11/4/2013*/hash_table.h#include#includetemplatevoid infor(const T1& para1=' ',const T2& para2='原创 2013-04-15 21:40:01 · 991 阅读 · 0 评论 -
归并排序
一、归并排序是稳定的排序方法二、时间复杂度为n*log(n)三、空间复杂度为n四、代码均通过vs2008编译运行 /************************************************************************//* copyright@Fisher Wang原创 2013-05-04 16:55:03 · 706 阅读 · 0 评论 -
雅虎北京研究院hack大赛题目
Question 1 / 5 (Problem A)Given a rational number expressed as A/B where A and B are integers, find the position of Mth occurrence of digit D (0-9) after decimal point. For example 3/7 = 0.4285714原创 2013-05-08 20:44:16 · 1290 阅读 · 0 评论 -
雅虎北京研究院hack大赛
Question 1 / 5 (Problem A)Given a rational number expressed as A/B where A and B are integers, find the position of Mth occurrence of digit D (0-9) after decimal point. For example 3/7 = 0.4285714原创 2013-05-08 20:46:02 · 1574 阅读 · 1 评论 -
hash_map和map的区别
文章来源:http://blog.csdn.net/dongtingzhizi/article/details/8629285 在网上看了一篇《详细解说STL hash_map系列》的文章(http://blog.163.com/liuruigong_lrg/blog/static/27370306200711334341781/),以及一些其他关于STL map和has转载 2015-01-13 20:46:44 · 3118 阅读 · 1 评论