排序:
默认
按更新时间
按访问量

leetcode: LRU Cache

import java.util.Map; import java.util.HashMap; public class LRUCache {     Map cacheMap; ListNode head; ListNode tail; public int cap;...

2014-10-10 20:04:21

阅读数:395

评论数:0

leetcode: Unique Paths

public class Solution { public int uniquePaths(int m, int n) { int i; double result=1.0; n=n-1; m=m+n-1; ...

2014-07-01 22:06:20

阅读数:305

评论数:0

leetcode: Rotate List

/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = ...

2014-06-19 15:13:24

阅读数:333

评论数:0

leetcode: Permutation Sequence

这个题要求全排列的第几个。 首先我们知道,A(n,m)=n!/(n-m)

2014-06-11 15:26:55

阅读数:348

评论数:0

如何实现ArrayList<E>泛型的复制

问题解释: 现在一个类

2014-05-26 18:03:48

阅读数:1139

评论数:0

【算法】关于最小子串和的扩展

子串是连续的,子序列是不连续的。 最小zichuanhe

2014-05-19 15:21:19

阅读数:380

评论数:0

leetcode: Insert Interval

因为原来的intervals是不想交且的,所以对原来的每一个区间,和要插入的区间对比,考虑如下情况: 绿色表示当前的intervals[i],黑色表示新的interval。 /** * Definition for an interval. * public class Int...

2014-05-15 17:23:12

阅读数:308

评论数:0

leetcode:Reverse Words in a String

public class Solution { public static String reverseWords(String s) { String rst=""; int n=s.length(); int i,j; for(i=n-1;i>=0;...

2014-05-10 23:27:17

阅读数:374

评论数:0

leetcode: Merge Intervals

/** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { start = 0; end = 0; } * Inte...

2014-05-10 22:08:59

阅读数:326

评论数:0

leetcode: Jump Game

public class Solution {     public boolean canJump(int[] A) {        int i,j;         int prev0=-1;         int n=A.length;         int max=0; ...

2014-05-10 21:25:41

阅读数:284

评论数:0

leetcode: Maximum Subarray

public class Solution { public int maxSubArray(int[] A) { int n=A.length; int[] F=new int[n]; int max,i; F[0]=A[0]; max=A[0]; f...

2014-05-08 21:45:48

阅读数:308

评论数:0

leetcode: Spiral Matrix

考虑四种情况: 设m为有几横行,n为有几竖列, 第一种情况是m>n && n%2==1; 第二种情况是m>n && n%2==0; 第三种情况是m 第四种情况是m 分别算出每一中情况的终点[endx,endy] 每次找一下一个点,只...

2014-05-08 21:31:57

阅读数:371

评论数:0

leetcode: N-Queens

public class Solution { public static ArrayList solveNQueens(int n) { int[] trace=new int[n]; int i,j,x; ArrayList rst=new ArrayList(); St...

2014-05-08 19:00:56

阅读数:299

评论数:0

leetcode:Pow(x, n)

public class Solution { public static double pow(double x, int n) { if(x!=0 && n==0) return 1; if(x==0 &&...

2014-05-08 01:13:35

阅读数:300

评论数:0

leetcode:Anagrams

public class Solution { public static ArrayList anagrams(String[] strs) { int m=strs.length; int i,j,n; int[][] map=new int[...

2014-05-07 19:05:41

阅读数:287

评论数:0

leetcode: Rotate Image

n X n的考虑到: 第一象限的点全

2014-05-06 19:16:31

阅读数:384

评论数:0

leetcode: Permutations/Permutations II

按照字典序依次写,求一个序列的下一字典序序列: A[0] A[0] A[0] A[0]

2014-05-06 12:23:18

阅读数:319

评论数:0

leetcode:Jump Game II

public class Solution { public int jump(int[] A) { int n=A.length; int[] maxstep=new int[n]; int i,j,max,tmp;; if(n<2) ...

2014-05-05 23:16:16

阅读数:311

评论数:0

leetcode:Wildcard Matching

public class Solution {     public static boolean isMatch(String s, String p) {   if(s.equals(""))     return p.equals("")?tr...

2014-05-05 11:15:33

阅读数:390

评论数:0

wireshark抓包提示There are no interfaces on which a capture can be done

windows下运行wireshark抓包, 提示There are no interfaces on which a capture can be done, 是因为权限不够,选择“以管理员身份”

2014-05-05 11:00:31

阅读数:679

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭