HashTable
所难
这个作者很懒,什么都没留下…
展开
-
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, whe原创 2014-08-19 18:54:55 · 446 阅读 · 0 评论 -
LeetCode-Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.原创 2014-07-28 12:49:51 · 407 阅读 · 0 评论 -
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?Solution:Code:/** * Definition fo原创 2014-07-29 09:50:03 · 376 阅读 · 0 评论 -
LeetCode-Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution:Code:/** * Definition for singly-linked list. * struct ListNode原创 2014-07-29 09:55:17 · 426 阅读 · 0 评论 -
LeetCode-Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each原创 2014-07-30 10:52:59 · 395 阅读 · 0 评论 -
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, 3原创 2014-07-31 13:19:20 · 327 阅读 · 0 评论