码迷,mamicode.com
首页 >  
搜索关键字:linux运维 面试 应用软件    ( 23027个结果
LeetCode: First Missing Positive [040]
【题目】 Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant space. 【题意】 给定一个数组,找出第一个缺失的正数。时间复杂度O(n) ...
分类:其他好文   时间:2014-05-21 17:13:07    阅读次数:219
LeetCode: Combination Sum II [039]
【题目】 Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combination. Note: All numbers (including target) will be ...
分类:其他好文   时间:2014-05-21 15:55:25    阅读次数:259
【Android进阶】Android面试题目整理与讲解
这一篇文章专门整理一下研究过的Android面试题,内容会随着学习不断的增加,如果答案有错误,希望大家可以指正 1.简述Activity的生命周期 当Activity开始启动的时候,首先调用onCreate(),onStart(),onResume()方法,此时Activity对用户来说,是可见的状态 当Activity从可见状态变为被Dialog遮挡的状态的时候,会调用on...
分类:移动开发   时间:2014-05-21 15:43:02    阅读次数:333
LeetCode: Combination Sum [038]
【题目】 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number of times. Note: All numbers (including target) w...
分类:其他好文   时间:2014-05-21 15:21:28    阅读次数:292
LeetCode: Count and Say [037]
【题目】 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n, generate...
分类:其他好文   时间:2014-05-21 15:20:07    阅读次数:213
编程之美之2.7 最大公约数问题
问题: 求两个数的最大公约数 解法一: 欧几里得辗转相除法: f(x,y) = GCD(x,y), 取k = x / y, b = x % y,则:x = k*y + b; 如果一个数能整除x,y,则它也能整除b,y; 而且能整除b,y的数必能整除x,y,即x,y和b,y的公约数是相同的,其最大公约数也是相同的,即f(x,y) = f(y ,x % y) (x>=y>0)...
分类:其他好文   时间:2014-05-21 09:28:26    阅读次数:275
Java程序初始化的顺序是怎样的
在Java语言中,当实例化对象时,对象所在类的所有成员变量首先要进行初始化,只有当所有类成员完成初始化后,才会调用对象所在类的构造函数创建对象。...
分类:编程语言   时间:2014-05-21 08:58:13    阅读次数:303
编程之美之2.5 寻找最大的K个数
【题目】 有很多无序的数,从中找出最大的K个数。假定他们都不相等。 【解法一】 如果数据不是很多,例如在几千个左右,我们可以排一下序,从中找出最大的K个数。排序可以选择快速排序或者堆排序 [cpp] view plaincopy #include   #include   int cmp(const void *a,const ...
分类:其他好文   时间:2014-05-21 07:30:07    阅读次数:234
LeetCode: Trapping Rain Water [041]
【题目】 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. The above elevation map is represente...
分类:移动开发   时间:2014-05-21 06:44:38    阅读次数:359
算法之大数问题
大数相加 [cpp] view plaincopy #include   #include      char a[10001],b[10001],sum[10002];      int BigIntegerAdd(){       //两个数的长度       int lena = strlen(a);       int l...
分类:其他好文   时间:2014-05-21 06:32:32    阅读次数:361
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!