码迷,mamicode.com
首页 >  
搜索关键字:return array    ( 86705个结果
【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-05-23 07:43:23    阅读次数:246
LeetCode: Search Insert Position [034]
【题目】 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Here are few examples. [1,3,5,6], 5 → 2 [1,3,5,6]...
分类:其他好文   时间:2014-05-22 09:41:59    阅读次数:195
leetcode Longest Common Prefix
找出单词的最长公共前缀 class Solution { public: string longestCommonPrefix(vector &strs) { int len=strs.size(); if(len==0) return ""; int length=strs[0].size(),j; ...
分类:其他好文   时间:2014-05-22 09:35:20    阅读次数:230
return 和 exit 的区别
return 和 exit 的区别 exit()          表示结束当前进程或当前程序,在整个程序中,只要有                   exit,就退出,并将应用程序的一个状态返回给OS。一般   和操作系统相关的是0为正常退出,非0为非正常退出。 return:     表示调用堆栈的返回。例如当程序进入函数调用时,当函数                   ...
分类:其他好文   时间:2014-05-22 06:22:02    阅读次数:258
JS常用表单验证总结
表单验证 function check_1(param){//不为空     if(param==""||param==null){return false;}else{return true;}     } function check_2(param){//长度限制,字母是10个,汉字也是10个     if(param.length>10){return false;}else...
分类:Web程序   时间:2014-05-20 17:15:45    阅读次数:414
LeetCode:Single Number II
题目:     Given an array of integers, every element appears three times except for one. Find that single one.     Note:     Your algorithm should have a linear runtime complexity. Could you implem...
分类:其他好文   时间:2014-05-20 16:22:52    阅读次数:241
javascript判断浏览器类型
window["MzBrowser"]={};(function() { if(MzBrowser.platform) return; var ua = window.navigator.userAgent; MzBrowser.platform = window.navigator.platform; MzBrowser.firefox = ua.indexOf("Firefox")>0; Mz...
分类:编程语言   时间:2014-05-20 14:38:05    阅读次数:239
Leetcode:Plus One
戳我去解题Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit ...
分类:其他好文   时间:2014-05-20 10:42:14    阅读次数:244
Leetcode:Merge Two Sorted Lists
戳我去解题Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.分析:直...
分类:其他好文   时间:2014-05-20 08:52:09    阅读次数:277
Leetcode:Remove Nth Node From End of List
戳我去解题Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. Aft...
分类:其他好文   时间:2014-05-20 08:04:28    阅读次数:291
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!