码迷,mamicode.com
首页 >  
搜索关键字:hash tree    ( 28321个结果
[leetcode]Validate Binary Search Tree @ Python
原题地址:https://oj.leetcode.com/problems/validate-binary-search-tree/题意:检测一颗二叉树是否是二叉查找树。解题思路:看到二叉树我们首先想到需要进行递归来解决问题。这道题递归的比较巧妙。让我们来看下面一棵树: ...
分类:编程语言   时间:2014-05-26 10:48:19    阅读次数:291
[leetcode]Same Tree @ Python
原题地址:https://oj.leetcode.com/problems/same-tree/题意:判断两棵树是否是同一棵树。解题思路:这题比较简单。用递归来做。首先判断两个根节点的值是否相同,如果相同,递归判断根的左右子树。代码:# Definition for a binary tree n....
分类:编程语言   时间:2014-05-26 10:30:17    阅读次数:289
[leetcode]Symmetric Tree @ Python
原题地址:https://oj.leetcode.com/problems/symmetric-tree/题意:判断二叉树是否为对称的。Given a binary tree, check whether it is a mirror of itself (ie, symmetric around ...
分类:编程语言   时间:2014-05-26 10:18:52    阅读次数:293
angular学习笔记(十七)-路由和切换视图
本篇介绍angular中如何通过判断url的hash值来显示不同的视图模板,并使用不同的控制器:下面,通过一个例子,来一步一步说明它的用法:我们要做一个邮箱应用,打开的时候显示的是邮件列表:然后点击邮件主题,可以查看该邮件的详细内容:点击返回列表,再回到列表页一. 创建index页面: 14.1路....
分类:其他好文   时间:2014-05-26 08:40:30    阅读次数:301
Memcached分布式缓存
公司要使用Memcached来作为app的缓存使用,所以简单整理了下网上搜到的资料Memcache简介Memcache集群环境下缓存解决方案Memcache是一个高性能的分布式的内存对象缓存系统,用于在动态应用中减少负载,提升访问速度。通过在内存里维护一个统一的巨大的hash表,它能够用来存储各种格...
分类:其他好文   时间:2014-05-26 08:39:01    阅读次数:610
leetcode题目:Sum Root to Leaf Numbers和Longest Consecutive Sequence
题目一: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Fin...
分类:其他好文   时间:2014-05-26 04:06:41    阅读次数:248
poj 2985 The k-th Largest Group 求第K大数 Treap, Binary Index Tree, Segment Tree
题目链接:点击打开链接 题意:有两种操作,合并集合,查询第K大集合的元素个数。(总操作次数为2*10^5) Treap模板(静态数组) #include #include #include #include #include const int maxNode = 500000 + 100; const int inf = 0x3f3f3f3f; struct Tr...
分类:其他好文   时间:2014-05-24 23:18:09    阅读次数:522
POJ 1054 The Troublesome Frog
这能叫DP???hash+枚举点+剪枝就能过?? 题目大意: 当青蛙经过农田时的痕迹是一条直线。农田里的植物就在这个农田的二维坐标系的整数格点上。如果某只青蛙经过农田,也就是某条直线穿过农田。那么那条直线经过的所有的整数格点上的植物会都被破坏掉。现在给出所有被破坏的植物的位置,问那只青蛙破坏的最多。 本题有几个地方需要注意: 1、当某条直线上某个点没被破坏,这条直线...
分类:其他好文   时间:2014-05-24 21:56:41    阅读次数:209
poj 3031 Big Christmas Tree(水spfa)
http://poj.org/problem?id=3013 题意: Because of a technical difficulty, price of an edge will be (sum of weights of all descendant nodes) × (unit price of the edge).这句话一直没看懂。后面还以为是最小生成树。 正确...
分类:其他好文   时间:2014-05-24 20:27:13    阅读次数:266
50. 树的子结构[subtree structure in tree]
subtree structure in tree
分类:其他好文   时间:2014-05-24 09:23:20    阅读次数:283
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!