<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[X2321002的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/X2321002</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; X2321002]]></copyright><item><title><![CDATA[算法概论 习题8.20]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/75089022</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/75089022</guid><author>X2321002</author><pubDate>Thu, 13 Jul 2017 18:07:12 +0800</pubDate><description><![CDATA[本篇为算法课期末作业。
题目是8.20.
原题：在一个无向图G=（V,E）中，我们称为一个占优集，是指每个都属于D或者D中一个节点为邻。在占优集问题中，输入为一个图和预算b，目标是求图的一个规模不超过b的控制集——如果该集存在。证明该问题是NP-完全的。


解答：可以将顶点覆盖问题归约到支配集问题。若要在图G(V, E)中求得不大于b的一个顶点覆盖，可以先对图G 做一个预处理：对每条边]]></description><category></category></item><item><title><![CDATA[134. Gas Station]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73522405</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73522405</guid><author>X2321002</author><pubDate>Tue, 20 Jun 2017 23:30:46 +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[542. 01 Matrix]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73522221</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73522221</guid><author>X2321002</author><pubDate>Tue, 20 Jun 2017 22:59:39 +0800</pubDate><description><![CDATA[Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.
The distance between two adjacent cells is 1.

Example 1: 
Input:
0 0 0
0 1 0
0 0 0

Output:
0 0 0
0 1 0
0 ]]></description><category></category></item><item><title><![CDATA[133. Clone Graph（DFS）]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73506208</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73506208</guid><author>X2321002</author><pubDate>Tue, 20 Jun 2017 19:04:03 +0800</pubDate><description><![CDATA[Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.


OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each]]></description><category></category></item><item><title><![CDATA[210. Course Schedule II（DFS）]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73370340</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73370340</guid><author>X2321002</author><pubDate>Sat, 17 Jun 2017 11:49:38 +0800</pubDate><description><![CDATA[There are a total of n courses you have to take, labeled from 0 to n
 - 1.

Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as]]></description><category></category></item><item><title><![CDATA[388. Longest Absolute File Path]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73002348</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73002348</guid><author>X2321002</author><pubDate>Sat, 10 Jun 2017 19:02:29 +0800</pubDate><description><![CDATA[原题过长就不拷过来了，题目要求是找出文件系统中的最长绝对路径
原题地址：https://leetcode.com/problems/longest-absolute-file-path/#/description
输入的是一个字符串，如字符串"dir\n\tsubdir1\n\tsubdir2\n\t\tfile.txt"表示如下的文件系统：
dir
subdir1
subdir2
f]]></description><category></category></item><item><title><![CDATA[215. Kth Largest Element in an Array]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/73001026</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/73001026</guid><author>X2321002</author><pubDate>Sat, 10 Jun 2017 18:34:52 +0800</pubDate><description><![CDATA[原题目是
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.
For example,
Given [3,2,1,5,6,4] and k = 2, return]]></description><category></category></item><item><title><![CDATA[23. Merge k Sorted Lists]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/72862023</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/72862023</guid><author>X2321002</author><pubDate>Sun, 04 Jun 2017 22:11:35 +0800</pubDate><description><![CDATA[原本想找一篇与分治策略有关的题目，便搜索了merge类的题目挑一篇做。
题目是Merge k sorted
 linked lists and return it as one sorted list. Analyze and describe its complexity.
大意是将K个已经排好序的链表合并成一个链表。一开始打算运用分治法将其一分二，二分四分成n个基本子问题来求解，但由于链]]></description><category></category></item><item><title><![CDATA[找出数组中唯二出现一次的数]]></title><link>https://blog.youkuaiyun.com/X2321002/article/details/57412409</link><guid>https://blog.youkuaiyun.com/X2321002/article/details/57412409</guid><author>X2321002</author><pubDate>Sun, 26 Feb 2017 13:46:29 +0800</pubDate><description><![CDATA[原题取自https://leetcode.com/problems/single-number-iii/?tab=Description
题目要求找出数组中唯二出现一次的数，其余数均只出现两次。 要求做到算法的时间复杂度为O(n)
解题最直接的方法是计算出数组中每个数出现的次数，然后取其中出现一次的，但其算法复杂度不满足题目要求
这里采用异或计算的方法来求解
由于 A ^A = 0,，A ]]></description><category></category></item></channel></rss>