码迷,mamicode.com
首页 >  
搜索关键字:trie 树    ( 65186个结果
Leetcode 树 Binary Tree Level Order Traversal
题意:给定一棵二叉树,返回按层遍历的结果 思路1:bfs,定义一个新的struct,记录指针向节点的指针和每个节点所在的层 复杂度1:时间O(n),空间O(n) 思路2:dfs 递归函数: void levelOrder(TreeNode *root, int level, vector<vector >&result) 表示把根为root的树按层存放在result中,其中level表示当前的层数 复杂度2:时间O(n),空间O(n) 相关题目:...
分类:其他好文   时间:2014-05-15 14:46:06    阅读次数:355
Leetcode 树 Unique Binary Search TreesII
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Unique Binary Search Trees II  Total Accepted: 7349 Total Submissions: 27648 Given n, generate all structurally unique ...
分类:其他好文   时间:2014-05-15 07:02:36    阅读次数:252
平衡二叉树(AVL树)的实现
一步一步实现平衡二叉树,并对AVL树的旋转操作进详细解释...
分类:其他好文   时间:2014-05-15 06:27:41    阅读次数:215
Leetcode 树 Binary Tree Inorder Traversal
题意:中序遍历 思路:采用递归实现。因为函数声明是返回一个vector,所以每个子树返回的是该子树的中序遍历的结果 按照 左、根、右的次序把根和左右子树的vector合并起来就可以了...
分类:其他好文   时间:2014-05-15 06:21:09    阅读次数:255
JQuery日记_5.13 Sizzle选择器(六)选择器的效率
当选择表达式不符合快速匹配(id,tag,class)和原生QSA不可用或返回错误时,将调用select(selector, context, results, seed)方法,此方法迭代DOM选择、过滤元素, 在DOM树非常大的时候为了保证效率,应该保证html设计的合理,尽量使用可快速匹配(id,tag,class)的表达式,其次是QSA支持的选择器,尽量不要使用jquery扩展的selec...
分类:Web程序   时间:2014-05-15 05:22:20    阅读次数:327
Leetcode 树 Binary Tree Preorder Traversal
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Binary Tree Preorder Traversal  Total Accepted: 17948 Total Submissions: 51578 Given a binary tree, return the preorder tra...
分类:其他好文   时间:2014-05-15 04:37:26    阅读次数:283
UVa 10308 Roads in the North 树的直径
题目来源:UVa 10308 Roads in the North 题意:求距离最远的2点之间的距离 思路:裸的树的直径 或者树形DP #include #include #include using namespace std; const int maxn = 100010; struct node { int to, w; node(){} node(int to, int...
分类:其他好文   时间:2014-05-15 03:37:18    阅读次数:295
HDU 1561 The more ,The Better
HDU 1561 The more ,The Better...
分类:其他好文   时间:2014-05-15 02:57:01    阅读次数:182
NYOJ 674 善良的国王(树形背包DP)
NYOJ 674 善良的国王(树形背包DP)...
分类:其他好文   时间:2014-05-14 14:59:43    阅读次数:310
android点滴之ViewTreeObserver
一类的基本概念 这是一个注册监听视图树的观察者(observer),在视图树种全局事件改变时得到通知。这个全局事件不仅还包括整个树的布局,从绘画过程开始,触摸模式的改变等。 二类的主要接口:监听器 interface  ViewTreeObserver.OnGlobalFocusChangeListener          当在一个视图树中的焦点状态发生改变时,所要调用的回调函数...
分类:移动开发   时间:2014-05-14 14:35:07    阅读次数:296
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!