- 博客(14)
- 资源 (2)
- 收藏
- 关注
原创 Simplify Path
Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" 算法:根据/把path分割,再逐个判断 public class Solution { public
2014-11-24 22:36:08 714
原创 Pow(x, n)
Implement pow(x, n). public class Solution { public double pow(double x, int n) { //判断x是不是0 if(Math.abs(x-0)<0.0000001) return 1; //指数为负数 if(n<0){
2014-11-23 19:53:18 479
原创 Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2014-11-18 20:23:04 766
原创 Implement strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02): The signature of the function had been updat
2014-11-17 18:59:26 529
原创 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Element
2014-11-15 20:02:09 699
原创 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2014-11-15 19:10:10 715
原创 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c
2014-11-15 18:18:19 693
原创 leetcode--Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the
2014-11-13 16:16:16 470
原创 leetcode--Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of
2014-11-13 13:09:50 704
原创 leetcode--Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 算法:
2014-11-12 16:19:32 660
原创 leetcode--Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers
2014-11-12 15:56:29 611
原创 leetcode--Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length.
2014-11-12 14:18:45 505
原创 leetcode--Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a
2014-11-12 14:04:53 568
原创 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.
2014-11-12 14:01:26 480
jQueryFileUploadMaster 插件 spring mvc简单整合
2013-08-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人