<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[denisewu的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/denisewu</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; denisewu]]></copyright><item><title><![CDATA[如何解决socket通信server端的address already in use的错误]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/50461550</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/50461550</guid><author>denisewu</author><pubDate>Tue, 05 Jan 2016 11:53:20 +0800</pubDate><description><![CDATA[最近用Python 的socketserver框架进行TCP/IP socket服务器端的项目。但是服务器主程序正常退出以后，再启动该服务器主程序就会遇到Address already in use这个错误
这个错误其实是由bind()函数抛出的。但是这个错误绝对不是由于服务器程序退出的时候忘记close
 socket造成的。
http://www.ibm.com/developerwor]]></description><category></category></item><item><title><![CDATA[Leetcode: Dungeon Game]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44286735</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44286735</guid><author>denisewu</author><pubDate>Mon, 16 Mar 2015 00:47:04 +0800</pubDate><description><![CDATA[分析：


At first glance, this problem bears a large resemblance to the "Maximum/Minimum Path Sum" problem. However,
 a path with maximum overall health gain does not guarantee the minimum initial he]]></description><category></category></item><item><title><![CDATA[LeetCode: linked list cycle I and II]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44279319</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44279319</guid><author>denisewu</author><pubDate>Sun, 15 Mar 2015 18:47:27 +0800</pubDate><description><![CDATA[Given a linked list, determine if it has a cycle in it.

Follow up:
Can you solve it without using extra space?



这道题非常常见，http://blog.youkuaiyun.com/hf81970/article/details/14169655 这篇文章讲的非常全面。分析简单明]]></description><category></category></item><item><title><![CDATA[Leetcode: Fraction to Recurring Decimal]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44278905</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44278905</guid><author>denisewu</author><pubDate>Sun, 15 Mar 2015 18:02:07 +0800</pubDate><description><![CDATA[Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.

If the fractional part is repeating, enclose the repeating part in parentheses.
]]></description><category></category></item><item><title><![CDATA[Leetcode: Repeated DNA Sequence]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44277209</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44277209</guid><author>denisewu</author><pubDate>Sun, 15 Mar 2015 15:01:46 +0800</pubDate><description><![CDATA[All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.

Wri]]></description><category></category></item><item><title><![CDATA[Leetcode: Roman To Integer]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44250329</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44250329</guid><author>denisewu</author><pubDate>Sat, 14 Mar 2015 00:23:34 +0800</pubDate><description><![CDATA[这道题本来很简单，可是需要注意的是从细节上进行性能改进。一开始我是用Map来存储罗马字母和数字的对应关系，结果发现性能比较差。而改为switch，并且将之写成子函数，并将函数设置Inline,性能得到改进。
因此，如果需要建立映射关系的时候，如果映射的组数比较少的时候，应该尝试使用switch来建立映射关系。如果子函数较小，且被频繁调用，那么应该将该函数设置为inline。这样函数代码会内嵌到代]]></description><category></category></item><item><title><![CDATA[LeetCode: sudoku solver and valid sudoku]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44202965</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44202965</guid><author>denisewu</author><pubDate>Wed, 11 Mar 2015 19:26:24 +0800</pubDate><description><![CDATA[problem: valid sudoku
Determine if a Sudoku is valid, according to: Sudoku
 Puzzles - The Rules.


The Sudoku board could be partially filled, where empty cells are filled with the character '.'.]]></description><category></category></item><item><title><![CDATA[LeetCode: Validate Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44174361</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44174361</guid><author>denisewu</author><pubDate>Tue, 10 Mar 2015 13:48:14 +0800</pubDate><description><![CDATA[Given a binary tree, determine if it is a valid binary search tree (BST).

Assume a BST is defined as follows:

The left subtree of a node contains only nodes with keys less than the node's key.Th]]></description><category></category></item><item><title><![CDATA[LeetCode: Recover Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44162191</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44162191</guid><author>denisewu</author><pubDate>Mon, 09 Mar 2015 22:34:44 +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[LeetCode: Reverse Bits]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44157879</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44157879</guid><author>denisewu</author><pubDate>Mon, 09 Mar 2015 18:07:54 +0800</pubDate><description><![CDATA[Reverse bits of a given 32 bits unsigned integer.

For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as0011100101]]></description><category></category></item><item><title><![CDATA[Leetcode: Permutation Sequence]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44101517</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44101517</guid><author>denisewu</author><pubDate>Fri, 06 Mar 2015 16:43:43 +0800</pubDate><description><![CDATA[题目：


The set [1,2,3,…,n] contains a total of n!
 unique permutations.

By listing and labeling all of the permutations in order,
We get the following sequence (ie, for n = 3):

"123""132""21]]></description><category></category></item><item><title><![CDATA[Leetcode: Count and Say]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44100453</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44100453</guid><author>denisewu</author><pubDate>Fri, 06 Mar 2015 15:41:33 +0800</pubDate><description><![CDATA[The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...

1 is read off as "one
 1" or 11.
11 is read off as "two
 1s" or 21.
21 is read off as ]]></description><category></category></item><item><title><![CDATA[leetcode: Palindrome Partitioning]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44067497</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44067497</guid><author>denisewu</author><pubDate>Wed, 04 Mar 2015 22:33:39 +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
  []]></description><category></category></item><item><title><![CDATA[LeetCode: Construct Binary Tree from Inorder and Postorder Traversal]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/44064475</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/44064475</guid><author>denisewu</author><pubDate>Wed, 04 Mar 2015 19:48:42 +0800</pubDate><description><![CDATA[问题：
Given inorder and postorder traversal of a tree, construct the binary tree.
解答：
这是非常常规的递归问题。需要注意的是递归函数参数的设计。如果设置为题目早前设定的TreeNode *buildTree(vector &inorder, vector &postorder)，那么在大数据情况下 ，会出现调用栈]]></description><category></category></item><item><title><![CDATA[leetcode: Combination Sum]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/43874659</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/43874659</guid><author>denisewu</author><pubDate>Wed, 18 Feb 2015 02:19:47 +0800</pubDate><description><![CDATA[Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
 the candidate numbers sums to T.

The same repeated number may be chosen from C unlimited numb]]></description><category></category></item><item><title><![CDATA[LeetCode : Container With Most Water]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/43854789</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/43854789</guid><author>denisewu</author><pubDate>Mon, 16 Feb 2015 21:01:37 +0800</pubDate><description><![CDATA[i, j分别从头尾开始遍历，面积 area = min(height[j], height[i]) * (j-i)，
当height[i] 


class Solution {
public:
    int maxArea(vector &height) {
        int water = 0;
        if(height.size() < 2)
           ]]></description><category></category></item><item><title><![CDATA[LeetCode：Trapping Rain Water]]></title><link>https://blog.youkuaiyun.com/denisewu/article/details/43837425</link><guid>https://blog.youkuaiyun.com/denisewu/article/details/43837425</guid><author>denisewu</author><pubDate>Sun, 15 Feb 2015 20:32:32 +0800</pubDate><description><![CDATA[算法很简单，核心思想是：对某个值A[i]来说，能trapped的最多的water取决于在i之前最高的值leftMostHeight[i]和在i右边的最高的值rightMostHeight[i]。（均不包含自身）。如果min(left,right) > A[i]，那么在i这个位置上能trapped的water就是min(left,right) – A[i]。

有了这个想法就好办了，第一遍从左到]]></description><category></category></item></channel></rss>