码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
#Leet Code# Divide Two Integers
描述:不使用 * / % 完成除法操作。O(n)复杂度会超时,需要O(lg(n))复杂度。代码: 1 class Solution: 2 # @return an integer 3 def dividePositive(self, dividend, divisor): 4 ...
分类:其他好文   时间:2014-07-16 19:18:00    阅读次数:298
强大自己的js库(持续跟新)
①判断是否是整数!function isInteger(obj) {return typeof obj === 'number' && obj%1 === 0}
分类:Web程序   时间:2014-07-16 18:54:20    阅读次数:226
LeetCode--Reverse Words in a String
class Solution {public: void reverseWords(string &s) { int len = s.length(); if(len == 0) return; vector res; ...
分类:其他好文   时间:2014-07-16 18:50:12    阅读次数:161
理解Java常量池
JVM运行时数据区的内存模型由五部分组成:【1】方法区【2】堆【3】JAVA栈【4】PC寄存器【5】本地方法栈对于String s = "haha" ,它的虚拟机指令:0: ldc #16; //String haha2: astore_13: return对于上面虚拟机指令,其各自的指令流程在《深...
分类:编程语言   时间:2014-07-16 18:48:18    阅读次数:217
Poj 1159
题意;5Ab3bd加上多少个字符可以是字符串为回文串#includeusing namespace std;short dp[5005][5005];char s1[5005],s2[5005];int fmax(int x,int y){ if(x>y) return x; return y;}i...
分类:其他好文   时间:2014-07-16 18:39:41    阅读次数:164
[leetcode]Letter Combinations of a Phone Number
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ...
分类:其他好文   时间:2014-07-16 17:54:24    阅读次数:222
(java) Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { 7 * ...
分类:编程语言   时间:2014-07-16 17:45:41    阅读次数:226
javascript里的封装
用javascript闭包的特性,可以模拟实现私有变量、私有方法。 1 var myObject = =(function(){ 2 var privateValue; 3 function privateMethod(){} 4 5 return { 6 ...
分类:编程语言   时间:2014-07-16 17:44:30    阅读次数:237
JavaScript自己模仿jQuery的一点小代码
function seter(sId) { var obj = document.getElementById(sId); return new function () { var objN = obj; this.html = function (sHtml) { objN.innerHTML =...
分类:编程语言   时间:2014-07-16 17:43:21    阅读次数:224
LeetCode——Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1-...
分类:其他好文   时间:2014-07-16 17:30:52    阅读次数:230
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!