<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[smallfish_yy的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/smallfish_yy</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; smallfish_yy]]></copyright><item><title><![CDATA[系统内存分配]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/39471871</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/39471871</guid><author>smallfish_yy</author><pubDate>Mon, 22 Sep 2014 08:07:01 +0800</pubDate><description><![CDATA[http://www.cnblogs.com/dartagnan/archive/2011/09/11/2173520.html
http://www.inf.udec.cl/~leo/teoX.pdf]]></description><category></category></item><item><title><![CDATA[选择爱人的数学方法（经典秘书问题）]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/39023711</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/39023711</guid><author>smallfish_yy</author><pubDate>Wed, 03 Sep 2014 10:10:37 +0800</pubDate><description><![CDATA[http://www.cnblogs.com/TenosDoIt/p/3747946.html]]></description><category></category></item><item><title><![CDATA[[LeetCode] - Gas Station]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/38534381</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/38534381</guid><author>smallfish_yy</author><pubDate>Wed, 13 Aug 2014 11:35:25 +0800</pubDate><description><![CDATA[There are N gas stations along a circular route, where the amount of gas at station i is gas[i].

You have a car with an unlimited gas tank and it costs cost[i] of gas
 to travel from station i to ]]></description><category></category></item><item><title><![CDATA[[LeetCode] - Surrounded Regions]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/38531671</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/38531671</guid><author>smallfish_yy</author><pubDate>Wed, 13 Aug 2014 09:02:29 +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]]></description><category></category></item><item><title><![CDATA[[LeetCode] - Longest Consecutive Sequence]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/38531595</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/38531595</guid><author>smallfish_yy</author><pubDate>Wed, 13 Aug 2014 08:44:31 +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[[LeetCode] - Reorder List]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/38488507</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/38488507</guid><author>smallfish_yy</author><pubDate>Mon, 11 Aug 2014 10:51:30 +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[浅谈构造函数与析构函数的调用顺序]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/24832425</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/24832425</guid><author>smallfish_yy</author><pubDate>Thu, 01 May 2014 08:59:12 +0800</pubDate><description><![CDATA[构造函数
    先看看构造函数的调用顺序规则，只要我们在平时编程的时候遵守这种约定，任何关于构造函数的调用问题都能解决；构造函数的调用顺序总是如下：
1.基类构造函数。如果有多个基类，则构造函数的调用顺序是某类在类派生表中出现的顺序，而不是它们在成员初始化表中的顺序。
2.成员类对象构造函数。如果有多个成员类对象则构造函数的调用顺序是对象在类中被声明的顺序，而不是它们出现在成员初始化表中的]]></description><category></category></item><item><title><![CDATA[两个subarrray的题目]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/23237379</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/23237379</guid><author>smallfish_yy</author><pubDate>Wed, 09 Apr 2014 05:44:24 +0800</pubDate><description><![CDATA[两个subarrray的题目，]]></description><category></category></item><item><title><![CDATA[[Leetcode] - Minimum Window Substring]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/20888431</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/20888431</guid><author>smallfish_yy</author><pubDate>Mon, 10 Mar 2014 04:09:41 +0800</pubDate><description><![CDATA[Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).

For example,
S = "ADOBECODEBANC"
T = "ABC"


Minimum window is "BAN]]></description><category></category></item><item><title><![CDATA[[Leetcode] - Max Points on a Line]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/20759107</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/20759107</guid><author>smallfish_yy</author><pubDate>Sat, 08 Mar 2014 10:23:48 +0800</pubDate><description><![CDATA[Given n points
 on a 2D plane, find the maximum number of points that lie on the same straight line.

这道题第一次见到是在Cracking上面。第一次做的时候感觉自己的想法好复杂啊，然后看答案之后才豁然开朗。哎，还是菜。大概的思路是这样的。对于一条直线而言，在解析几何中有若干种表示方法，我记]]></description><category></category></item><item><title><![CDATA[[Leetcode] - Longest Substring Without Repeating Characters]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/20685115</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/20685115</guid><author>smallfish_yy</author><pubDate>Fri, 07 Mar 2014 07:41:05 +0800</pubDate><description><![CDATA[Given a string, find the length of the longest substring without repeating characters. For
 example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo]]></description><category></category></item><item><title><![CDATA[[Leetcode] - Simplify Path]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/20618485</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/20618485</guid><author>smallfish_yy</author><pubDate>Thu, 06 Mar 2014 12:36:39 +0800</pubDate><description><![CDATA[Given an absolute path for a file (Unix-style), simplify it.

For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"


click to show corner cases.

Corner Cases:


Did ]]></description><category></category></item><item><title><![CDATA[最长递增子序列 O(NlogN)算法]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/20602375</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/20602375</guid><author>smallfish_yy</author><pubDate>Thu, 06 Mar 2014 07:35:27 +0800</pubDate><description><![CDATA[今天学习了求最长递增子序列这个题的O(NlogN)的解法。记录一下大概的思路，要不然过一段时间又该忘了。
基本思路就是维护一个数组，假设为DP。DP[i]所记录的是，在原始数组的所有长度为i+1的单调递增子序列中，结尾处元素的最小值。同时还需要一个变量len，用来记录当前所遇到的所有元素能组成的递增子序列的最大长度。分析后可以发现，DP这个数组一定是有序的，所以每次对它的更新，可以用二分法来实现]]></description><category></category></item><item><title><![CDATA[Morris Traversal]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19673367</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19673367</guid><author>smallfish_yy</author><pubDate>Sat, 22 Feb 2014 09:14:31 +0800</pubDate><description><![CDATA[http://blog.youkuaiyun.com/ithomer/article/category/694817]]></description><category></category></item><item><title><![CDATA[Convert Sorted List to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19107981</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19107981</guid><author>smallfish_yy</author><pubDate>Wed, 12 Feb 2014 09:09:42 +0800</pubDate><description><![CDATA[Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.

Analysis: 
/**
 * Definition for singly-linked list.
 * public class ListNode {
 *    ]]></description><category></category></item><item><title><![CDATA[Binary Tree Maximum Path Sum]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19067779</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19067779</guid><author>smallfish_yy</author><pubDate>Tue, 11 Feb 2014 09:00:48 +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[Anagrams]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19063007</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19063007</guid><author>smallfish_yy</author><pubDate>Tue, 11 Feb 2014 02:54:07 +0800</pubDate><description><![CDATA[Given an array of strings, return all groups of strings that are anagrams.

Note: All inputs will be in lower-case.
Analysis: Using a hash table groups all anagrams together. We can sort each strin]]></description><category></category></item><item><title><![CDATA[[LeetCode] - Copy List with Random Pointer]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19061857</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19061857</guid><author>smallfish_yy</author><pubDate>Tue, 11 Feb 2014 02:41:03 +0800</pubDate><description><![CDATA[A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.

Return a deep copy of the list.


Version 1: Time complexity O]]></description><category></category></item><item><title><![CDATA[[LeetCode] - Recover Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19037729</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19037729</guid><author>smallfish_yy</author><pubDate>Mon, 10 Feb 2014 14:59:01 +0800</pubDate><description><![CDATA[Two elements of a binary search tree (BST) are swapped by mistake.

Recover the tree without changing its structure.
Note:
A solution using O(n)
 space is pretty straight forward. Could you devis]]></description><category></category></item><item><title><![CDATA[Valid Palindrome]]></title><link>https://blog.youkuaiyun.com/smallfish_yy/article/details/19032203</link><guid>https://blog.youkuaiyun.com/smallfish_yy/article/details/19032203</guid><author>smallfish_yy</author><pubDate>Mon, 10 Feb 2014 11:07:14 +0800</pubDate><description><![CDATA[Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a ]]></description><category></category></item></channel></rss>