![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode题解
文章平均质量分 79
Enockipp
目前小硕在读中
展开
-
Leet Code:Single Number
class Solution {public: int singleNumber(int A[], int n) { int res=A[0]; for(int i=1;i<n;++i) res^=A[i]; return res; }};原创 2014-04-30 21:45:46 · 768 阅读 · 0 评论 -
LeetCode之Insert Interval--二分查找
题目描述Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start t原创 2014-06-02 23:22:56 · 1301 阅读 · 0 评论 -
LeetCode之Gas Station --环形加油站周游
题目解法原创 2014-05-02 15:54:55 · 2301 阅读 · 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? 做法原创 2014-04-28 21:27:45 · 1155 阅读 · 0 评论 -
LeetCode:Reorder List
题目Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it t原创 2014-04-28 20:48:55 · 657 阅读 · 0 评论 -
Leetcode: LRU Cache
转自:http://blog.csdn.net/doc_sgl/article/details/15378513转载 2014-04-27 21:38:07 · 698 阅读 · 0 评论 -
Leetcode: Max Points on a Line
Max Points on a Line http://oj.leetcode.com/problems/max-points-on-a-line/给你一组点,求共线最多点的个数。思路,暴力枚举,以每个“点”为中心,然后遍历剩余点,求出以i为起点j为终点的斜率(j>i),斜率相同的点一定共线。对每个i,初始化一个哈希表,key 为斜率,value 为该直线上的点数。转载 2014-04-26 21:57:37 · 1606 阅读 · 0 评论 -
leetcode难度及面试频率
zhuan 1Two Sum25arraysort setTwo Pointers2Add Two Numbers转载 2014-05-17 22:19:31 · 2052 阅读 · 0 评论 -
Leet Code: Single Number II
题目解法代码原创 2014-05-01 11:58:25 · 788 阅读 · 0 评论 -
leetcode之Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.这道题一开始没看懂题目原创 2014-08-24 10:23:37 · 1048 阅读 · 0 评论