<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/AAA428</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; AAA428]]></copyright><item><title><![CDATA[ddd]]></title><link>https://blog.csdn.net/AAA428/article/details/18814013</link><guid>https://blog.csdn.net/AAA428/article/details/18814013</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 14:46:26 +0800</pubDate><description><![CDATA[Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the following condi]]></description><category></category></item><item><title><![CDATA[Binary Tree Zigzag Level Order Traversal (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18812311</link><guid>https://blog.csdn.net/AAA428/article/details/18812311</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 13:10:35 +0800</pubDate><description><![CDATA[Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).

For example:
Given binary ]]></description><category></category></item><item><title><![CDATA[Convert Sorted List to Binary Search Tree (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18812185</link><guid>https://blog.csdn.net/AAA428/article/details/18812185</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 12:57:39 +0800</pubDate><description><![CDATA[Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
用start和end两个point来记录当前的sublist，每次取中间值create new TreeNode后，用递归分别创建left subtree和right subtr]]></description><category></category></item><item><title><![CDATA[Path Sum II (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18811867</link><guid>https://blog.csdn.net/AAA428/article/details/18811867</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 11:58:16 +0800</pubDate><description><![CDATA[Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
 = 22,
              5
             / \
    ]]></description><category></category></item><item><title><![CDATA[Flatten Binary Tree to Linked List (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18811581</link><guid>https://blog.csdn.net/AAA428/article/details/18811581</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 11:43:49 +0800</pubDate><description><![CDATA[Given a binary tree, flatten it to a linked list in-place.

For example,
Given
         1
        / \
       2   5
      / \   \
     3   4   6



The flattened tree should look like:
   1
   ]]></description><category></category></item><item><title><![CDATA[Populating Next Right Pointers in Each Node II (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18810989</link><guid>https://blog.csdn.net/AAA428/article/details/18810989</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 11:16:34 +0800</pubDate><description><![CDATA[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 still work?

Note:

You may only use constant ]]></description><category></category></item><item><title><![CDATA[Distinct Subsequences (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18809527</link><guid>https://blog.csdn.net/AAA428/article/details/18809527</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 10:01:27 +0800</pubDate><description><![CDATA[Given a string S and a string T, count the number of distinct subsequences of T in S.

A subsequence of a string is a new string which is formed from the original string by deleting some (can be non]]></description><category></category></item><item><title><![CDATA[Edit Distance (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18808749</link><guid>https://blog.csdn.net/AAA428/article/details/18808749</guid><author>AAA428</author><pubDate>Mon, 27 Jan 2014 09:08:58 +0800</pubDate><description><![CDATA[Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)

You have the following 3 operations permitted on a word:]]></description><category></category></item><item><title><![CDATA[Binary Tree Maximum Path Sum (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18793937</link><guid>https://blog.csdn.net/AAA428/article/details/18793937</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 12:50:37 +0800</pubDate><description><![CDATA[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   3




Return 6]]></description><category></category></item><item><title><![CDATA[Word Ladder (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18793829</link><guid>https://blog.csdn.net/AAA428/article/details/18793829</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 12:23:50 +0800</pubDate><description><![CDATA[Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:

Only one letter can be changed at a timeEach intermediate word m]]></description><category></category></item><item><title><![CDATA[Longest Consecutive Sequence (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18793725</link><guid>https://blog.csdn.net/AAA428/article/details/18793725</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 12:07:36 +0800</pubDate><description><![CDATA[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]]></description><category></category></item><item><title><![CDATA[Palindrome Partitioning (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18793499</link><guid>https://blog.csdn.net/AAA428/article/details/18793499</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 11:51:11 +0800</pubDate><description><![CDATA[Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
  [
    ["aa","b"],]]></description><category></category></item><item><title><![CDATA[Reorder List (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18790131</link><guid>https://blog.csdn.net/AAA428/article/details/18790131</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 07:39:57 +0800</pubDate><description><![CDATA[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 to ]]></description><category></category></item><item><title><![CDATA[Sort List (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18789753</link><guid>https://blog.csdn.net/AAA428/article/details/18789753</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 07:12:54 +0800</pubDate><description><![CDATA[Sort a linked list in O(n log n)
 time using constant space complexity.

看到 O(nlogn)第一想到的是merge sort，这里采用的是每次merge前遍历当前list，找到中间节点，然后对head和中间节点分别再进行sort，再merge。
或者也可以用两个point，start和end，当start==end]]></description><category></category></item><item><title><![CDATA[Evaluate Reverse Polish Notation  (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18789721</link><guid>https://blog.csdn.net/AAA428/article/details/18789721</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 07:09:05 +0800</pubDate><description><![CDATA[用了stack，遍历数组，遇到数字就push，遇到运算符，取出stack中最近入栈的两个数进行计算，然后继续入栈。
最后return stack中的结果即可


public int evalRPN(String[] tokens) {
        if(tokens.length==0)
            return 0;
        Stack stack  = new]]></description><category></category></item><item><title><![CDATA[Insertion Sort List (LeetCode)]]></title><link>https://blog.csdn.net/AAA428/article/details/18789649</link><guid>https://blog.csdn.net/AAA428/article/details/18789649</guid><author>AAA428</author><pubDate>Sun, 26 Jan 2014 07:04:05 +0800</pubDate><description><![CDATA[public ListNode insertionSortList(ListNode head) {
        // IMPORTANT: Please reset any member data you declared, as
        // the same Solution instance will be reused for each test case.]]></description><category></category></item></channel></rss>