Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen...
分类:
其他好文 时间:
2015-07-25 08:20:07
阅读次数:
125
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2015-07-23 06:51:31
阅读次数:
110
117 Populating Next Right Pointers in Each Node II就是 Bibary Tree Level order Traverseclass Solution: # @param root, a tree link node # @return n...
分类:
其他好文 时间:
2015-07-23 06:45:54
阅读次数:
119
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2015-07-22 22:23:45
阅读次数:
166
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2015-07-22 22:11:30
阅读次数:
101
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-07-20 21:27:30
阅读次数:
96
题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array/
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length....
分类:
其他好文 时间:
2015-07-19 18:05:55
阅读次数:
84
As explained in the Solution tag, the key to solving this problem is to use invariants. We set two pointers:lfor the left andrfor the right. One key i...
分类:
其他好文 时间:
2015-07-19 16:23:24
阅读次数:
94
Reverse a singly linked list.Thoughts:1.Iterative Method.Loop the linked list, set two pointers, one called"first" to always point to the head of the ...
分类:
其他好文 时间:
2015-07-18 07:04:45
阅读次数:
103
问题描述Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next po...
分类:
其他好文 时间:
2015-07-17 20:19:44
阅读次数:
109