码迷,mamicode.com
首页 >  
搜索关键字:leetcode easy    ( 39612个结果
Jquery Easy-UI 树形菜单的运用
一、树形菜单的右键标签 期中增加同级机构、增加下属机构、修改、删除分别是调用了addNode(),del()等方法。 新增同级机构 新增下属机...
分类:Web程序   时间:2014-04-30 00:49:12    阅读次数:599
LeetCode——Gray Code
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
iOS 7 自定义Back按钮 与 Pop interactive gesture
1、自定义Back按钮iOS中很多时候我们都会自定义返回按钮,也是一件easy的事,类似如下: 1 - (void)showNavBackButton 2 { 3 UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCust...
分类:移动开发   时间:2014-04-29 23:38:27    阅读次数:1253
从n个元素中选择k个的所有组合(包含重复元素)
LeetCode:Combinations这篇博客中给出了不包含重复元素求组合的5种解法。我们在这些解法的基础上修改以支持包含重复元素的情况。对于这种情况,首先肯定要对数组排序,以下不再强调修改算法1:按照求包含重复元素集合子集的方法LeetCode:Subsets II算法1的解释,我们知道:若当...
分类:其他好文   时间:2014-04-28 14:00:43    阅读次数:717
[LeetCode] 时间复杂度 O(n),空间复杂度 O(1) 的动态规划算法,题 Jump Game
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
LeetCode OJ - Sum Root to Leaf Numbers
这道题也很简单,只要把二叉树按照宽度优先的策略遍历一遍,就可以解决问题,采用递归方法越是简单。下面是AC代码: 1 /** 2 * Sum Root to Leaf Numbers 3 * 采用递归的方法,宽度遍历 4 */ 5 int result=0; 6...
分类:其他好文   时间:2014-04-28 10:05:40    阅读次数:682
[leetcode] Add Binary
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
[Leetcode] ZigZag Conversion
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
[Leetcode] 4Sum
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
leetcode day4 -- Binary Tree Postorder(Preorder) Traversal && Edit Distance
?? 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!