<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[ststns的专栏]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/ststns</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; ststns]]></copyright><item><title><![CDATA[Palindrome Partitioning]]></title><link>https://blog.csdn.net/ststns/article/details/45481107</link><guid>https://blog.csdn.net/ststns/article/details/45481107</guid><author>ststns</author><pubDate>Mon, 04 May 2015 14:49:47 +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","]]></description><category></category></item><item><title><![CDATA[Surrounded Regions]]></title><link>https://blog.csdn.net/ststns/article/details/45479643</link><guid>https://blog.csdn.net/ststns/article/details/45479643</guid><author>ststns</author><pubDate>Mon, 04 May 2015 13:42:17 +0800</pubDate><description><![CDATA[Given a 2D board containing 'X' and 'O',
 capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's
 into 'X's in that surrounded region.
For example,

X X X X
X O O X
X X]]></description><category></category></item><item><title><![CDATA[Sum Root to Leaf Numbers]]></title><link>https://blog.csdn.net/ststns/article/details/45459421</link><guid>https://blog.csdn.net/ststns/article/details/45459421</guid><author>ststns</author><pubDate>Sun, 03 May 2015 16:06:47 +0800</pubDate><description><![CDATA[Given a binary tree containing digits from 0-9 only, each root-to-leaf path
 could represent a number.

An example is the root-to-leaf path 1->2->3 which represents the number 123.

Find the tota]]></description><category></category></item><item><title><![CDATA[Longest Consecutive Sequence]]></title><link>https://blog.csdn.net/ststns/article/details/45459137</link><guid>https://blog.csdn.net/ststns/article/details/45459137</guid><author>ststns</author><pubDate>Sun, 03 May 2015 15:25:51 +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[Word Ladder]]></title><link>https://blog.csdn.net/ststns/article/details/45419125</link><guid>https://blog.csdn.net/ststns/article/details/45419125</guid><author>ststns</author><pubDate>Fri, 01 May 2015 14:05:19 +0800</pubDate><description><![CDATA[Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord to endWord, such that:

Only one letter can be changed at a timeEach int]]></description><category></category></item><item><title><![CDATA[Binary Tree Maximum Path Sum]]></title><link>https://blog.csdn.net/ststns/article/details/45366711</link><guid>https://blog.csdn.net/ststns/article/details/45366711</guid><author>ststns</author><pubDate>Wed, 29 Apr 2015 14:57:27 +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[Best Time to Buy and Sell Stock III]]></title><link>https://blog.csdn.net/ststns/article/details/45366319</link><guid>https://blog.csdn.net/ststns/article/details/45366319</guid><author>ststns</author><pubDate>Wed, 29 Apr 2015 14:34:09 +0800</pubDate><description><![CDATA[Say you have an array for which the ith element is the price of a given stock on day i.

Design an algorithm to find the maximum profit. You may complete at most two transactions.

Note:

You ma]]></description><category></category></item><item><title><![CDATA[Best Time to Buy and Sell Stock II]]></title><link>https://blog.csdn.net/ststns/article/details/45310063</link><guid>https://blog.csdn.net/ststns/article/details/45310063</guid><author>ststns</author><pubDate>Mon, 27 Apr 2015 14:39:22 +0800</pubDate><description><![CDATA[Say you have an array for which the ith element is the price of a given stock on day i.

Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on]]></description><category></category></item><item><title><![CDATA[Best Time to Buy and Sell Stock II]]></title><link>https://blog.csdn.net/ststns/article/details/45308637</link><guid>https://blog.csdn.net/ststns/article/details/45308637</guid><author>ststns</author><pubDate>Mon, 27 Apr 2015 12:34:01 +0800</pubDate><description><![CDATA[Say you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),]]></description><category></category></item><item><title><![CDATA[Triangle]]></title><link>https://blog.csdn.net/ststns/article/details/45308507</link><guid>https://blog.csdn.net/ststns/article/details/45308507</guid><author>ststns</author><pubDate>Mon, 27 Apr 2015 12:15:46 +0800</pubDate><description><![CDATA[Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.

For example, given the following triangle

[
     [2],
    [3,4],
   []]></description><category></category></item><item><title><![CDATA[Populating Next Right Pointers in Each Node II]]></title><link>https://blog.csdn.net/ststns/article/details/45246199</link><guid>https://blog.csdn.net/ststns/article/details/45246199</guid><author>ststns</author><pubDate>Fri, 24 Apr 2015 14:33:15 +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[Populating Next Right Pointers in Each Node]]></title><link>https://blog.csdn.net/ststns/article/details/45221655</link><guid>https://blog.csdn.net/ststns/article/details/45221655</guid><author>ststns</author><pubDate>Thu, 23 Apr 2015 14:48:29 +0800</pubDate><description><![CDATA[Given a binary tree
    struct TreeLinkNode {
      TreeLinkNode *left;
      TreeLinkNode *right;
      TreeLinkNode *next;
    }




Populate each next pointer to point to its next right node. ]]></description><category></category></item><item><title><![CDATA[Pascal's Triangle II]]></title><link>https://blog.csdn.net/ststns/article/details/45220395</link><guid>https://blog.csdn.net/ststns/article/details/45220395</guid><author>ststns</author><pubDate>Thu, 23 Apr 2015 13:11:10 +0800</pubDate><description><![CDATA[Given an index k, return the kth row of the Pascal's triangle.

For example, given k = 3,
Return [1,3,3,1].

Note:
Could you optimize your algorithm to use only O(k) extra space?
trick在于从后往前扫，不]]></description><category></category></item><item><title><![CDATA[Pascal's Triangle]]></title><link>https://blog.csdn.net/ststns/article/details/45220209</link><guid>https://blog.csdn.net/ststns/article/details/45220209</guid><author>ststns</author><pubDate>Thu, 23 Apr 2015 12:46:53 +0800</pubDate><description><![CDATA[Given numRows, generate the first numRows of Pascal's triangle.

For example, given numRows = 5,
Return
[
     [1],
    [1,1],
   [1,2,1],
  [1,3,3,1],
 [1,4,6,4,1]
]



class Solution {
publi]]></description><category></category></item><item><title><![CDATA[Path Sum II]]></title><link>https://blog.csdn.net/ststns/article/details/45128433</link><guid>https://blog.csdn.net/ststns/article/details/45128433</guid><author>ststns</author><pubDate>Sun, 19 Apr 2015 13:33:08 +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[Path Sum]]></title><link>https://blog.csdn.net/ststns/article/details/45128307</link><guid>https://blog.csdn.net/ststns/article/details/45128307</guid><author>ststns</author><pubDate>Sun, 19 Apr 2015 13:14:05 +0800</pubDate><description><![CDATA[Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum]]></description><category></category></item><item><title><![CDATA[Minimum Depth of Binary Tree]]></title><link>https://blog.csdn.net/ststns/article/details/45112781</link><guid>https://blog.csdn.net/ststns/article/details/45112781</guid><author>ststns</author><pubDate>Sat, 18 Apr 2015 13:47:44 +0800</pubDate><description><![CDATA[Given a binary tree, find its minimum depth.

The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.




教科书也不为过啊。。。




/**
 * ]]></description><category></category></item><item><title><![CDATA[Balanced Binary Tree]]></title><link>https://blog.csdn.net/ststns/article/details/45112707</link><guid>https://blog.csdn.net/ststns/article/details/45112707</guid><author>ststns</author><pubDate>Sat, 18 Apr 2015 13:35:47 +0800</pubDate><description><![CDATA[Given a binary tree, determine if it is height-balanced.

For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe]]></description><category></category></item><item><title><![CDATA[Convert Sorted List to Binary Search Tree]]></title><link>https://blog.csdn.net/ststns/article/details/45112541</link><guid>https://blog.csdn.net/ststns/article/details/45112541</guid><author>ststns</author><pubDate>Sat, 18 Apr 2015 13:11:22 +0800</pubDate><description><![CDATA[Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.


其实挺难的，一次写对更难。 这种sorted array/list to balanced tree的题目就是递归的找中间然后左右继续


linked list不]]></description><category></category></item><item><title><![CDATA[Convert Sorted Array to Binary Search Tree]]></title><link>https://blog.csdn.net/ststns/article/details/45096017</link><guid>https://blog.csdn.net/ststns/article/details/45096017</guid><author>ststns</author><pubDate>Fri, 17 Apr 2015 13:40:16 +0800</pubDate><description><![CDATA[Given an array where elements are sorted in ascending order, convert it to a height balanced BST.


divide and conquer


/**
 * Definition for binary tree
 * struct TreeNode {
 *     int val;
 *]]></description><category></category></item></channel></rss>