F_G

许多问题需要说清楚就可以&&走永远比跑来的重要

导航

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页

2015年8月12日 #

[Leetcode] 3Sum

摘要: 这道题目实际上有非常好的O(N^2)的解法。关键是利用了2sum的线性解法public class Solution { public List> threeSum(int[] nums) { List> res = new LinkedList>(); if(nu... 阅读全文

posted @ 2015-08-12 20:21 F_G 阅读(195) 评论(0) 推荐(0) 编辑

[Leetcode] Add Two Numbers

摘要: 数字表示为链表的格式,需要注意的几个地方:一、在计算过程当中要注意进位问题,刚开始的进位为0,后面进位要在计算过程当中进行更新。二、如果某个数字的list比较长,那么需要在最后将其加上三、最后如果进位不是零,说明需要额外增加一位代码如下: 1 /** 2 * Definition for sing... 阅读全文

posted @ 2015-08-12 20:15 F_G 阅读(164) 评论(0) 推荐(0) 编辑

[Leetcode] Two Sum

摘要: 1 import java.util.*; 2 3 public class Solution { 4 public int[] twoSum(int[] nums, int target) { 5 Map map = new HashMap(); 6 i... 阅读全文

posted @ 2015-08-12 20:12 F_G 阅读(166) 评论(0) 推荐(0) 编辑

[CTCI] Fobonacci Problem

摘要: The problem is well known, so there is no need to repeat it!we can apply the iteration function f(n+1) = f(n)+f(n-1), however the time complexity is O... 阅读全文

posted @ 2015-08-12 20:04 F_G 阅读(150) 评论(0) 推荐(0) 编辑

[Leetcode] Subset I

摘要: method 1: permutation !method 2: use integer and select element according to the bit in each integer. 阅读全文

posted @ 2015-08-12 17:12 F_G 阅读(102) 评论(0) 推荐(0) 编辑

[Leetcode] Permutation Sequence

摘要: crute method is RE!! 阅读全文

posted @ 2015-08-12 17:09 F_G 阅读(96) 评论(0) 推荐(0) 编辑

[Leetcode] Next Permutation

摘要: 1. From the last index, we seach the first decrease order, such i,i+1 and num[i] 14532 -> 14235The last step is to change the order from 5 to 2 to be ... 阅读全文

posted @ 2015-08-12 16:56 F_G 阅读(143) 评论(0) 推荐(0) 编辑

[Leetcode] Permutations II

摘要: The difference betweent Problem Permutation I and Permuation II lies in the duplicates elements may exist in the second one.For the first one , the en... 阅读全文

posted @ 2015-08-12 16:27 F_G 阅读(180) 评论(0) 推荐(0) 编辑

[Leetcode] Permutations

摘要: I have two solutions for this problem, the first one is from the undergraduate stage, the second one is from the CTCI (permute string)The common point... 阅读全文

posted @ 2015-08-12 15:59 F_G 阅读(175) 评论(0) 推荐(0) 编辑

2015年8月11日 #

Mysql当中的on和where的区别

摘要: MySQL当中的限制条件可以使用on或者where,两者在不同的情况下具有不同而意义如果是left join on,这里的on是对右表的限制,对左表没有限制如果是inner join on/where意思是一样的[1]http://www.jb51.net/article/39814.htm 阅读全文

posted @ 2015-08-11 23:33 F_G 阅读(514) 评论(0) 推荐(0) 编辑

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页