- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 Java 中String的HashCode计算方法
/** * Returns a hash code for this string. The hash code for a * String object is computed as * * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] * * usi
2014-05-13 21:33:11
7359
原创 [LeetCode] Two Sum
描述Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, w
2014-05-12 21:35:21
410
原创 [LeetCode] Longest Consecutive Sequence
描述Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1,2,
2014-05-12 21:15:11
338
转载 Top 10 Algorithms for Coding Interview 面试十大算法总结
The following are top 10 algorithms related topics for coding interviews. As understanding those concepts requires much more effort, this list below only serves as an introduction. They are viewed fro
2014-04-26 22:39:20
623
原创 [leetCode] LRU Cache (Java)
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) – Get the value (will always be positive) of the key if
2014-04-26 20:52:30
950
原创 [leetcode ]Search in Rotated Sorted Array
* Search 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 8 0 1 2 3. 6 7 8 0 1 2 3 4 5.You
2014-04-25 14:54:28
384
原创 [leetcode] Remove Duplicates from Sorted Array
描述Given a sorted array, remove the duplicates in place such that each element appear only onceand return the new length.Do not allocate extra space for another array, you must do this in place w
2014-04-24 12:36:00
395
原创 [LeetCode] Longest Common Prefix (LCP)
Write a function to find the longest common prefix string amongst an array of strings.模拟法,先选取第一个字符串,之后依次和后面的字符串得出LCP
2014-04-23 15:55:12
419
原创 [LeetCode] 4Sum
Question : 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:Elem
2014-04-23 15:03:36
371
原创 [Leetcode] Reverse Words in a String
Reverse Words in a StringGiven an input string, reverse the string word by word.
2014-04-23 14:44:47
447
原创 [LeetCode] Longest Palindromic Substring 最长回文子串
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.思路用一个指针从0遍历到s.size()-1
2014-04-23 14:16:44
429
转载 微软数据结构+算法面试100题
横空出世,席卷互联网 ---评微软数据结构+算法面试100题作者:July。时间:2010年10月-11月。版权所有,侵权必究。出处:http://blog.csdn.net/v_JULY_v。说明:本文原题为:“横空出世,
2014-04-18 13:13:30
676
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人