码迷,mamicode.com
首页 >  
搜索关键字:hash tree    ( 28321个结果
js实现HashTable
1.哈希表使用键值对进行的数据储存,在数据的存储位置和它的关键字之间建立一一对应的关系,从而使关键字和结构中的一个唯一的存储位置相对应,所以在检索数据时只需要根据这个关系便可以快速定位到要找的数据。 function HashTable(){ this._hash={}; this._c...
分类:Web程序   时间:2014-05-19 21:02:13    阅读次数:385
[LeetCode] [Balanced Binary Tree 2012-10-08 ]
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:其他好文   时间:2014-05-19 20:40:55    阅读次数:278
HDU 2795 Billboard(线段树)
题目链接:HDU 2795 Billboard【题意】给你一张h*w(1 7 #include 8 #include 9 using namespace std;10 const int MAX = 200005;11 12 int tree[MAX= val)26 {27 ...
分类:其他好文   时间:2014-05-19 10:09:17    阅读次数:419
编程之美2.12 快速寻找满足条件的两个数
问题描述:能否快速找到一个数组中的两个数字,让这两个数字之和等于一个给定的数字,为了简化起见,我们假设这个数组中肯定存在这样一组或以上符合条件的解。这里我们只考虑一种解的情况。解法:1. 暴力解法------O(n^2)2. 排序+二分查找------O(nlogn)3. hash表查找------...
分类:其他好文   时间:2014-05-19 08:51:09    阅读次数:313
Leetcode | Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:其他好文   时间:2014-05-17 14:45:17    阅读次数:290
uva 10391 Compound Words (字符串-hash)
uva 10391 Compound Words (字符串-hash) 题目大意: 有一堆按照字典序排好的字符串,问你有多少字符串是由其它两个字符串组成。 解题思路: 如果用两个字符串拼接看拼接好的字符串是否在字典中,一定会超时。 我们可以逆向,由于字符串的长度不是很长,所以把一个字符串拆为两个字符串看这两个字符串是否都在字典中即可 解题代码一: 判断字符串是否在字典中,可以用STL set,也是轻松AC 解题代码二: 判断字符串是否在字典中,可以用hash,于是手写ha...
分类:其他好文   时间:2014-05-16 02:48:12    阅读次数:377
poj 1200 Crazy Search
题目:     链接:点击打开链接 题意:     输入n和nc,以及字符串s,输出长度为n的不同字串的个数。 算法:      思路:     用hash判重(hash值。。。。。。),看了大牛的代码,对hash还是不甚理解。。。。 代码:#include #include #include #include using namespace std; #define MAXN 1...
分类:其他好文   时间:2014-05-15 23:25:24    阅读次数:404
Binary Tree Zigzag Level Order Traversal
原题: 题目解析:这个问题的实质是要我们按成访问二叉树的结点,并返回每层访问的结果,这里要求走Z字,其实就是一行正向一行反向。 /* the kernel idea is visit a binary search tree in level and the additional work we have to label the end of one level. */ v...
分类:其他好文   时间:2014-05-15 23:18:46    阅读次数:515
HDU 4006 求第k大数 treap
裸题,瞬秒。。 #include #include #include #include #include #include #include #include using namespace std; #define L(id) tree[id].ch[0] #define R(id) tree[id].ch[1] #define Size(id) tree[id].size #...
分类:其他好文   时间:2014-05-15 22:52:51    阅读次数:328
oracle表之间的连接之----->哈希连接(Hash Join)
oracle表之间的连接之哈希连接(Hash Join),其特点如下: 1,驱动表和被驱动表都是最多只被访问一次。 2,哈希连接的表有驱动顺序。 3,哈希表连接的表无需要排序,但是他在做连接之前做哈希运算的时候,会用到HASH_AREA_SIZE来创建哈希表。 4,哈希连接不适用于的连接条件是:不等于,小于 5,哈希连接索引列在表连接中无特殊要求,与单表情况无异。 下面我来做个实验来证...
分类:数据库   时间:2014-05-15 18:27:33    阅读次数:408
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!