### leetcode

1 已关注
9篇博文
• #### leetcode138: Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point t...

2016-05-12 21:56
607
• #### leetcode141： Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using ex...

2016-05-17 10:30
2308
• #### leetcode287: Find the Duplicate Number

数组中有n+1个数，范围为1～n，请证明至少存在一个重复的数字。假设只有一个重复的数，请找出这个数。 假设n=4，那么数组中应该有5个数，每个数的范围为1～4且只有一个重复的数字。数组在放完1 2 ...

2016-05-11 11:39
288
• #### leetcode19:Remove Nth Node From End of List

实现查找不难，两次遍历链表，第一遍记录链表长度，第二次直接遍历到倒数第k个即可。难点在于如何设计高效的算法一次遍历链表实现查找。成功则返回该节点data域的值，返回1；否则返回0。能否这样想，倒数第k...

2016-03-03 15:15
423
• #### google2016面试题-count of smaller numbers after self

2016-03-21 21:46
667
• #### leetcode20-valid parenthese

题目：Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the i...

2016-04-25 20:41
297
• #### leetcode136-137：single number

LC136和LC137这两个题很像，前者是一整数数组中，仅有一个元素出现一次，其余均出现两次，后者是仅有一个元素出现一次，其余均出现三次，都要求找到仅出现一次的那个元素。而且要求都在线性时间O(n)以...

2016-04-28 11:18
488
• #### leetcode260-single number iii

题目： Given an array of numbers nums, in which exactly two elements appear only once and all the oth...

2016-04-29 20:07
333
• #### leetcode151: symmetric tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). 判断一颗二...

2016-04-30 21:03
356