- 博客(17)
- 资源 (10)
- 收藏
- 关注
原创 leetcode:Merge Intervals
/** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { start = 0; end = 0; } * Interval(int s, int e) { start = s; end = e; } * } */
2014-10-23 00:15:11 311
原创 leetcode:Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at
2014-10-20 19:07:07 331
原创 Find Minimum in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. You may assume no duplicate exists in the ar
2014-10-19 22:09:10 391
原创 leetcode:Add Binary
public class Solution { public String addBinary(String a, String b) { char cha[] = a.toCharArray(); char chb[] = b.toCharArray(); char ans[] = new char[(cha.length > chb.le
2014-10-16 22:48:52 332
原创 leetcode:Implement strStr()
Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.
2014-10-16 11:55:51 381
原创 hihocoder:#1062 : 最近公共祖先·一
import java.util.*; public class Main{ public static void main(String[] args)throws Exception{ HashMap map = new HashMap<>(207); int curKey = 1; int cases = 0; Scanner cin = new Scanner(Sys
2014-10-10 23:05:06 675
原创 hihocoder:无间道之并查集
import java.util.*; public class Main{ public static void main(String[] args){ union_set s = new union_set(); int cases; Scanner cin = new Scanner(System.in); cases = cin.nextInt(); int o
2014-10-08 00:15:39 679
原创 leetcode:Sort List(链表的归并排序)
Sort a linked list in O(n log n) time using constant space complexity.
2014-10-07 20:28:09 516
原创 leetcode:Simplify Path
public class Solution { public String simplifyPath(String path) { char[] chs = path.toCharArray(); char[] charSta = new char[10000]; int top = 0; ArrayList wordSta
2014-10-06 12:56:52 419
原创 leetcode:Generate Parentheses
public class Solution { public List generateParenthesis(int n) { List result = new LinkedList<>(); result.add("()"); for (int i = 1; i < n; ++i) { Set buffer =
2014-10-06 10:30:41 382
原创 leetcode:Merge k Sorted Lists
Merge k Sorted Lists Total Accepted: 19819 Total Submissions: 92236 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
2014-10-05 23:28:09 330
原创 leetcode:Combinations
Combinations Total Accepted: 21741 Total Submissions: 71867 Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solutio
2014-10-05 16:53:30 465
原创 leetcode:Valid Parentheses
Valid Parentheses Total Accepted: 20398 Total Submissions: 71624 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The
2014-10-05 11:22:16 312
原创 leetcode:Reverse Linked List II
Reverse Linked List II Total Accepted: 20087 Total Submissions: 77182 Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NU
2014-10-05 11:05:15 414
原创 leetcode:Rotate List
题目描述: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. /** * Definition for
2014-10-04 23:12:36 350
axis2与spring集成
2015-05-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人