<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Arcome的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Arcome</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Arcome]]></copyright><item><title><![CDATA[2017.1.10 算法测试题集 - 1006 - 编辑距离问题]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54410457</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54410457</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 17:15:19 +0800</pubDate><description><![CDATA[Problem给定两个字符串s和t，要求给出由s编辑到t的最小步数。
编辑方式有三种，每次只能对一个字母或一个字母位置进行操作：
1. 插入，如 snowy->sunnowy
2. 删除，如 snowy->snwy
3. 替换，如 snowy->snony
Examples= "snowy"
t= "sunny"
Return 3
Algorithm编辑距离问题，是《算法概论》中在动态规划一节举的例]]></description><category></category></item><item><title><![CDATA[2017.1.10 算法测试题集 - 1005 - 最大间隔和]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54410444</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54410444</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 17:13:43 +0800</pubDate><description><![CDATA[Problem给定一组整数，要求只能间隔地取数出来，试问取出来的数最大和是多少？
ExampleA={1，2，3};
Return 4A={3,1,1,2};
Return 5;
Algorithm典型的动态规划问题。 
列状态转移方程：设sum[i]表示前i个数的最大间隔和，要求sum[i]，则有两种情况。
若选第i个数，则sum[i]=sum[i-2]+nums[i]
若不选第i个数，则sum[]]></description><category></category></item><item><title><![CDATA[2017.1.10 算法测试题集 - 1004 - 无环图]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54410421</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54410421</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 17:12:33 +0800</pubDate><description><![CDATA[Problem给定一个有向图，判断该有向图是否无环。
图的表示是一个整数n和一个pair为元素的向量。整数n表示点的个数
ExampleA={1，2，3};
B={3，2，4};
Return 3A={3,4,3,1};
B={1,2,2,6};
Return 2;
Algorithm会议室安排问题，与会议排期问题类似，可以联想到尝试贪心算法。每次都在还未安排的容量最大的会议室安排尽可能多的参会人数]]></description><category></category></item><item><title><![CDATA[2017.1.10 算法测试题集 - 1003 - 1的块数]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54410357</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54410357</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 17:06:10 +0800</pubDate><description><![CDATA[Problem给定一个0-1矩阵matrix，相邻的1视为“同一块”，问矩阵matrix有多少块1？
Example[1, 0, 0]
[0, 1, 0]
[0, 0, 1]
Return 3[1, 0, 0, 1]
[0, 1, 1, 0]
[0, 0, 0, 1]
Return 4;
Algorithm通过深度优先搜索来解决。遍历矩阵，若访问到1，则将这个1以及与它相连的所有1都置为0，同时块数]]></description><category></category></item><item><title><![CDATA[2017.1.10 算法测试题集 - 1002 - 相等二叉树]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54410327</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54410327</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 17:03:58 +0800</pubDate><description><![CDATA[Problem给定两棵二叉树，判断这两棵二叉树是否相等。
当且仅当两棵树结构相同且对应节点的取值也相同时，两棵二叉树相等。
ExampleA:  1
   / \
  2   3
 / \   \
5  6    7B:  1
   / \
  2   3
 / \ / 
5  6 7 C:  1
   / \
  2   3
 / \   \
5  6    7A==C,A!=B
Algorith]]></description><category></category></item><item><title><![CDATA[2017.1.10 算法测试题集 - 1001 - 会议安排问题]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54409855</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54409855</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 16:40:42 +0800</pubDate><description><![CDATA[Problem会议安排问题。有一组会议A和一组会议室B，A[i]表示第i个会议的参加人数，B[j]表示第j各会议室最多可以容纳的人数。当且仅当A[i]<=B[j]时，第j个会议室可以用于举办第i个会议。给定数组A和数组B，试问最多可以同时举办多少个会议。
ExampleA={1，2，3};
B={3，2，4};
Return 3A={3,4,3,1};
B={1,2,2,6};
Return 2;]]></description><category></category></item><item><title><![CDATA[算法概论 - 8.19]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54409799</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54409799</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 16:24:19 +0800</pubDate><description><![CDATA[Problem所谓风筝图是这样的，其顶点数为偶数（比如2n），且其中的n个顶点构成了一个团，剩余的n个顶点则由一条称为“尾巴”的路径连接，尾巴的某个端点与团中的一个顶点相连。给定一个图和目标g，风筝图问题要求该图的一个包含2g各顶点的风筝子图。请证明该问题是NP完全的。Solution可将最大团问题归约到风筝图问题。设有图G(V,E)，在G中添加V个新顶点，将这V各新顶点分别与G中各个不同的顶点相连]]></description><category></category></item><item><title><![CDATA[算法概论 - 8.15]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54409756</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54409756</guid><author>Arcome</author><pubDate>Fri, 13 Jan 2017 16:20:41 +0800</pubDate><description><![CDATA[Problem最大公共子图问题。 
证明如下问题是NP完全的： 
输入：两个图 G1=(V1,E1)G_1=(V_1,E_1) 和 G2=(V2,E2)G_2=(V_2,E_2)，预算bb； 
输出：两个节点集合V′1⊆V1V_1'\subseteq V_1和V′2⊆V2V_2'\subseteq V_2，它们被移除后，将在两图中分别留下至少bb个节点，且图的剩余部分完全一样。Solution可将最]]></description><category></category></item><item><title><![CDATA[算法概论 - 8.3]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/54380129</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/54380129</guid><author>Arcome</author><pubDate>Thu, 12 Jan 2017 17:36:10 +0800</pubDate><description><![CDATA[Problem吝啬SAT问题是这样的：给定一组子句（每个子句都是其中文字的析取）和整数k，求一个最多有k各变量为true的满足赋值 —— 如果该赋值存在。证明吝啬SAT是NP完全问题。Solution可以将SAT问题归约到此问题。首先，若得到了吝啬SAT问题的一个解，按照此解对吝啬SAT的每个子句赋值，即可验证这个解是否成立，这个过程是多项式时间的，所以吝啬SAT是NP问题。 
下面将SAT问题归约]]></description><category></category></item><item><title><![CDATA[LeetCode #39 - Combination Sum - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53888879</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53888879</guid><author>Arcome</author><pubDate>Mon, 26 Dec 2016 20:05:22 +0800</pubDate><description><![CDATA[Combination Sum Series
  Combination Sum I:
  
  Combination Sum II:
  
  Combination Sum III: http://blog.youkuaiyun.com/Arcome/article/details/53758448
ProblemGiven a set of candidate numbers (C) (without]]></description><category></category></item><item><title><![CDATA[LeetCode #90 - Subsets II - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53888852</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53888852</guid><author>Arcome</author><pubDate>Mon, 26 Dec 2016 20:01:22 +0800</pubDate><description><![CDATA[Subsets Series
  Subsets I: http://blog.youkuaiyun.com/arcome/article/details/53888806
  
  Subsets II: 
ProblemGiven a collection of integers that might contain duplicates, nums, return all possible subsets]]></description><category></category></item><item><title><![CDATA[LeetCode #78 - Subsets - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53888806</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53888806</guid><author>Arcome</author><pubDate>Mon, 26 Dec 2016 19:55:34 +0800</pubDate><description><![CDATA[ProblemGiven a set of distinct integers, nums, return all possible subsets.
Note: The solution set must not contain duplicate subsets.
ExampleFor example,
If nums = [1,2,3], a solution is:[
  [3],
  [1]]></description><category></category></item><item><title><![CDATA[LeetCode #210 - Course Schedule II - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53791005</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53791005</guid><author>Arcome</author><pubDate>Wed, 21 Dec 2016 20:36:36 +0800</pubDate><description><![CDATA[Course Schedule Series
  Course Schedule I: http://blog.youkuaiyun.com/Arcome/article/details/53790947
  
  Course Schedule II: 
ProblemThere are a total of n courses you have to take, labeled from 0 to n -]]></description><category></category></item><item><title><![CDATA[LeetCode #207 - Course Schedule - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53790947</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53790947</guid><author>Arcome</author><pubDate>Wed, 21 Dec 2016 20:33:53 +0800</pubDate><description><![CDATA[Course Schedule Series
  Course Schedule I: 
  
  Course Schedule II: 
ProblemThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example t]]></description><category></category></item><item><title><![CDATA[LeetCode #329 - Longest Increasing Path in a Matrix - Hard]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53790890</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53790890</guid><author>Arcome</author><pubDate>Wed, 21 Dec 2016 20:29:58 +0800</pubDate><description><![CDATA[ProblemGiven an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. 
You may NOT move diagonally or move outs]]></description><category></category></item><item><title><![CDATA[LeetCode #77 - Combinations - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53758488</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53758488</guid><author>Arcome</author><pubDate>Tue, 20 Dec 2016 08:12:02 +0800</pubDate><description><![CDATA[ProblemGiven two integers n and k, return all possible combinations of k numbers out of 1 ... n.
ExampleFor example,
If n = 4 and k = 2, a solution is:[
  [2,4],
  [3,4],
  [2,3],
  [1,2],
  [1,3],
  []]></description><category></category></item><item><title><![CDATA[LeetCode #89 - Gray Code - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53758478</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53758478</guid><author>Arcome</author><pubDate>Tue, 20 Dec 2016 08:07:58 +0800</pubDate><description><![CDATA[ProblemThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence o]]></description><category></category></item><item><title><![CDATA[LeetCode #46 - Permutations - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53758467</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53758467</guid><author>Arcome</author><pubDate>Tue, 20 Dec 2016 08:03:56 +0800</pubDate><description><![CDATA[Permutations Series
  Permutations I: 
  
  Permutations II: 
ProblemGiven a collection of distinct numbers, return all possible permutations.
Example[1,2,3] have the following permutations:
[
  [1,2,3]]></description><category></category></item><item><title><![CDATA[LeetCode #22 - Generate Parentheses - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53758457</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53758457</guid><author>Arcome</author><pubDate>Tue, 20 Dec 2016 08:00:20 +0800</pubDate><description><![CDATA[ProblemGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Examplegiven n = 3, a solution set is:[
  "((()))",
  "(()())",
  "(())()",
  "()(())",]]></description><category></category></item><item><title><![CDATA[LeetCode #216 - Combination Sum III - Medium]]></title><link>https://blog.youkuaiyun.com/Arcome/article/details/53758448</link><guid>https://blog.youkuaiyun.com/Arcome/article/details/53758448</guid><author>Arcome</author><pubDate>Tue, 20 Dec 2016 07:56:49 +0800</pubDate><description><![CDATA[Combination Sum Series
  Combination Sum I: 
  
  Combination Sum II: 
  
  Combination Sum III: 
ProblemFind all possible combinations of k numbers that add up to a number n, given that only numbers f]]></description><category></category></item></channel></rss>