码迷,mamicode.com
首页 >  
搜索关键字:part solution    ( 14980个结果
LeetCode --- Plus One
题目链接题意:给出一个以数组形式表示的数, 求该数加1后的结果,同样以数组形式返回。附上代码: 1 class Solution { 2 public: 3 vector plusOne(vector &digits) { 4 unsigned int len = digit...
分类:其他好文   时间:2014-05-12 12:49:34    阅读次数:268
LeetCode Maximal Rectangle
class Solution {public: int maximalRectangle(vector > &matrix) { int rows = matrix.size(); if (rows == 0) return 0; int cols =...
分类:其他好文   时间:2014-05-12 09:54:05    阅读次数:250
【LeetCode】Insertion Sort List
Sort a linked list using insertion sort.//用到O(N)的额外空间public class Solution { public ListNode insertionSortList(ListNode head) { if(head==nul...
分类:其他好文   时间:2014-05-11 23:59:09    阅读次数:405
Reading vmstat in linux – Part 1
Linuxcomeswithmanytoolstoenableadministratorstoevaluatetheperformanceofasystem.Oneoftheseveryusefultoolsisvmstat.VmstatisavailableonmostunixdistributionsandisincludedbydefaultonmanymodernLinuxdistributions.AswithmostLinuxcommands,builtinhelpisavailableviath..
分类:系统相关   时间:2014-05-11 19:39:38    阅读次数:680
Leetcode 位运算 Single Number
题意:在一组数组中除一个元素外其它元素都出现两次,找出这个元素 思路:位运算。异或。因为异或操作可以交换元素的顺序,所以元素异或的顺序没影响, 最后出现再次的元素都会被异或掉,相当于0和只出现一次的那个元素异或,结果还是那个元素 推广:这个方法也适合于出现其它元素都出现偶数次,而要找的元素出现奇数次的情况 相关题目:Single Number II class Solution...
分类:其他好文   时间:2014-05-11 02:37:42    阅读次数:397
LeetCode Insertion Sort List
class Solution {public: ListNode *insertionSortList(ListNode *head) { if (head == NULL) return NULL; ListNode* sorted_head = head; ...
分类:其他好文   时间:2014-05-10 20:39:14    阅读次数:419
【LeetCode】Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public String int...
分类:其他好文   时间:2014-05-10 20:31:10    阅读次数:335
[翻译] iOS开发工具的介绍(第一部分)
IOS DEVELOPMENT TIPS & TRICKS - PART Ihttp://blog.trifork.com/2013/12/19/ios-development-tips-tricks-part-i/As you might know, I am very fond of devel...
分类:移动开发   时间:2014-05-10 09:08:00    阅读次数:671
OWASP(Open Web Application Security Project) Top 10 for JavaScript
InjectionInjection flaws, such as SQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The ...
分类:移动开发   时间:2014-05-10 07:23:51    阅读次数:460
Leetcode: Search Insert Position
很简单的题目,一次过,注意为数组空的时候,应返回0而非null 1 public class Solution { 2 public int searchInsert(int[] A, int target) { 3 int i; 4 if (A.length...
分类:其他好文   时间:2014-05-10 06:51:21    阅读次数:288
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!