摘要:
http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/Given a binary tree struct TreeLinkNode { TreeLinkNode *left; ... 阅读全文
摘要:
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
摘要:
http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?F... 阅读全文
摘要:
Binary Tree Inorder TraversalTotal Accepted:16406Total Submissions:47212My SubmissionsGiven a binary tree, return theinordertraversal of its nodes' va... 阅读全文
摘要:
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir... 阅读全文
摘要:
http://oj.leetcode.com/problems/reverse-integer/public class Solution { public int reverse(int x) { String strX = Integer.toString(x); ... 阅读全文
摘要:
http://oj.leetcode.com/problems/same-tree/public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { Stack pstack = new... 阅读全文
摘要:
http://oj.leetcode.com/problems/maximum-depth-of-binary-tree/public class Solution { public int maxDepth(TreeNode root) { if(root!=null){ ... 阅读全文
摘要:
http://oj.leetcode.com/problems/minimum-path-sum/public class Solution { public int minPathSum(int[][] grid) { int row = grid.length; ... 阅读全文
摘要:
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文