一、树形菜单的右键标签
期中增加同级机构、增加下属机构、修改、删除分别是调用了addNode(),del()等方法。 新增同级机构 新增下属机...
分类:
Web程序 时间:
2014-04-30 00:49:12
阅读次数:
599
The gray code is a binary numeral system where
two successive values differ in only one bit.Given a non-negative
integernrepresenting the total number...
分类:
其他好文 时间:
2014-04-30 00:21:32
阅读次数:
536
1、自定义Back按钮iOS中很多时候我们都会自定义返回按钮,也是一件easy的事,类似如下:
1 - (void)showNavBackButton 2 { 3 UIButton *backButton = [UIButton
buttonWithType:UIButtonTypeCust...
分类:
移动开发 时间:
2014-04-29 23:38:27
阅读次数:
1253
LeetCode:Combinations这篇博客中给出了不包含重复元素求组合的5种解法。我们在这些解法的基础上修改以支持包含重复元素的情况。对于这种情况,首先肯定要对数组排序,以下不再强调修改算法1:按照求包含重复元素集合子集的方法LeetCode:Subsets
II算法1的解释,我们知道:若当...
分类:
其他好文 时间:
2014-04-28 14:00:43
阅读次数:
717
Jump GameGiven an array of non-negative
integers, you are initially positioned at the first index of the array.Each
element in the array represents yo...
分类:
其他好文 时间:
2014-04-28 11:30:27
阅读次数:
551
这道题也很简单,只要把二叉树按照宽度优先的策略遍历一遍,就可以解决问题,采用递归方法越是简单。下面是AC代码:
1 /** 2 * Sum Root to Leaf Numbers 3 * 采用递归的方法,宽度遍历 4 */ 5 int result=0; 6...
分类:
其他好文 时间:
2014-04-28 10:05:40
阅读次数:
682
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".给定两个二进制的字符串,返回他们的和。对于a,b两个二进制字符串,首先通过交换使a的长度小于b...
分类:
其他好文 时间:
2014-04-28 02:05:20
阅读次数:
502
The string"PAYPALISHIRING"is written in a
zigzag pattern on a given number of rows like this: (you may want to display
this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-04-27 21:36:45
阅读次数:
515
Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-04-27 20:55:03
阅读次数:
567
??
1、Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
retu...
分类:
其他好文 时间:
2014-04-27 18:58:59
阅读次数:
481