<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[as841175的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/as841175</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; as841175]]></copyright><item><title><![CDATA[算法作业：证明题（5）-- 8.12]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74613901</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74613901</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 22:16:06 +0800</pubDate><description><![CDATA[问题摘要：
证明如下问题是NP-完全问题，给定一个无向图G=（V，E）和整数k，求G中一个规模为k的团以及一个规模为k的独立集
证明：


a）对于团，因为对于V的子集V’，其每一对节点是由边集一条边相连，则团为G完全子图。又对于一个给定图G，对于顶点子集V’的任一对顶点（u，v），判断其是否属于E，可在多项式事件确定V’是否为团
设φ= C1∧C2∧C3...∧Ck为3-CNF中一个]]></description><category></category></item><item><title><![CDATA[算法作业：证明题（4）-- 8.12]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74611462</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74611462</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 20:42:05 +0800</pubDate><description><![CDATA[问题陈述：




证明：
a)∵给定一个图G的待定生成树，遍历生成树的每一个节点，检查每个点的度数是否小于等于k，可判定其是否满足k-生成树，判定过程时间复杂度O（V）
∴ k-生成树问题是一个搜索问题
b) ∵需要找到生成的树是否符合要求，检查需要遍历生成树的每一个节点，检查每个点的度数，这一步是时间复杂度是多项式，为V+E
     ∴k-生成树为NP问题
∵通过Rudr]]></description><category></category></item><item><title><![CDATA[算法作业HW30：LeetCode 235. Lowest Common Ancestor of a Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74611141</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74611141</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 20:34:07 +0800</pubDate><description><![CDATA[Description:


Given a binary search tree (BST), find
 the lowest common ancestor (LCA) of two given nodes in the BST.

 

Note:




According to the definition of LCA on Wikipedia: “The]]></description><category></category></item><item><title><![CDATA[算法作业HW29：LeetCode 219. Contains Duplicate II]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74610262</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74610262</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 20:23:57 +0800</pubDate><description><![CDATA[Description:


Given an array of integers and an integer k,
 find out whether there are two distinct indices i and j in
 the array 

 

Note:


such that nums[i] =
 nums[j] and the absolu]]></description><category></category></item><item><title><![CDATA[算法作业HW28：LeetCode 100. Same Tree]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74607819</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74607819</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 20:11:42 +0800</pubDate><description><![CDATA[Description:







Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the]]></description><category></category></item><item><title><![CDATA[算法作业HW27：LeetCode 28. Implement strStr()]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74605581</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74605581</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 19:58:00 +0800</pubDate><description><![CDATA[Description:





Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.


 

Note:



无










S]]></description><category></category></item><item><title><![CDATA[算法作业：证明题（3）-- 8.10]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74514435</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74514435</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 01:38:03 +0800</pubDate><description><![CDATA[问题描述：




证明：
a)
b)使g=|V|-1，可得到一个Rudrata路径
c)让g表示为子句的总数可得
d)使a*(a-1)/2 = b，这时候可成最大团问题，因为这使得a个顶点两两之间相互连接
e)要成最大独立子集问题，只需使b=0
f)对应了最小顶点集覆盖的推广
g)]]></description><category></category></item><item><title><![CDATA[算法作业HW26：LeetCode 27. Remove Element]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74512259</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74512259</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 00:45:40 +0800</pubDate><description><![CDATA[Description:



Given an array and a value, remove all instances of that value in place and return the new length.

Do not allocate extra space for another array, you must do this in place with ]]></description><category></category></item><item><title><![CDATA[算法作业HW25：LeetCode 26. Remove Duplicates from Sorted Array]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74512246</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74512246</guid><author>as841175</author><pubDate>Thu, 06 Jul 2017 00:45:29 +0800</pubDate><description><![CDATA[Description:

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this]]></description><category></category></item><item><title><![CDATA[算法作业：证明题（2）-- 8.8]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74356777</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74356777</guid><author>as841175</author><pubDate>Tue, 04 Jul 2017 20:41:48 +0800</pubDate><description><![CDATA[问题描述：





证明：]]></description><category></category></item><item><title><![CDATA[算法作业：证明题（1）-- 8.3]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74356742</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74356742</guid><author>as841175</author><pubDate>Tue, 04 Jul 2017 20:39:08 +0800</pubDate><description><![CDATA[题目描述：





证明：
∵STINGY SAT的解已知是在多项式时间内可验证
∴STINGY SAT是属于NP问题
∵通过将k设定为所有变量的总数，就可以把SAT 规约到STINGY SAT问题
∴STINGY SAT也为NP完全问题]]></description><category></category></item><item><title><![CDATA[算法作业HW24：LeetCode 24 Submission Details]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74355927</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74355927</guid><author>as841175</author><pubDate>Tue, 04 Jul 2017 19:56:08 +0800</pubDate><description><![CDATA[Description:




Given a linked list, swap every two adjacent nodes and return its head.


 

Note:









For example,
Given 1->2->3->4, you should return the list as 2->1->4->]]></description><category></category></item><item><title><![CDATA[算法作业HW23：LeetCode 31 Next Permutation]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74355885</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74355885</guid><author>as841175</author><pubDate>Tue, 04 Jul 2017 19:55:17 +0800</pubDate><description><![CDATA[Description:






Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.

If such arrangement is not possible, it must rearrange]]></description><category></category></item><item><title><![CDATA[算法作业HW22：LeetCode29 Divide Two Integers]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74275814</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74275814</guid><author>as841175</author><pubDate>Mon, 03 Jul 2017 20:43:50 +0800</pubDate><description><![CDATA[Description:








Divide two integers without using multiplication, division and mod operator.

If it is overflow, return MAX_INT.





 

Note:






None


Solution:]]></description><category></category></item><item><title><![CDATA[算法作业HW21：LeetCode 18 4Sum]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/74273843</link><guid>https://blog.youkuaiyun.com/as841175/article/details/74273843</guid><author>as841175</author><pubDate>Mon, 03 Jul 2017 19:57:13 +0800</pubDate><description><![CDATA[Description:

Given an array S of n integers,
 are there elements a, b, c,
 and d in S such
 that a + b + c + d =
 target? Find all unique quadruplets in the array which gives the sum of target.]]></description><category></category></item><item><title><![CDATA[算法作业HW20 202. Happy Number]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/73703242</link><guid>https://blog.youkuaiyun.com/as841175/article/details/73703242</guid><author>as841175</author><pubDate>Sun, 25 Jun 2017 11:57:01 +0800</pubDate><description><![CDATA[Description:






Write an algorithm to determine if a number is "happy".

A happy number is a number defined by the following process: Starting with any positive integer, replace the number]]></description><category></category></item><item><title><![CDATA[算法作业HW19 130. Surrounded Regions]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/73701534</link><guid>https://blog.youkuaiyun.com/as841175/article/details/73701534</guid><author>as841175</author><pubDate>Sun, 25 Jun 2017 11:12:47 +0800</pubDate><description><![CDATA[Description:



Given a 2D board containing 'X' and 'O' (the letter O),
 capture all regions surrounded by 'X'.

A region is captured by flipping all 'O's into 'X's
 in that surrounded region.]]></description><category></category></item><item><title><![CDATA[算法作业HW18：LeetCode102 Binary Tree Level Order Traversal]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/73699813</link><guid>https://blog.youkuaiyun.com/as841175/article/details/73699813</guid><author>as841175</author><pubDate>Sun, 25 Jun 2017 11:04:39 +0800</pubDate><description><![CDATA[Description:




  Given a binary tree, return the level
 order traversal of its nodes' values. (ie, from left to right, level by level).

Note:



For example:
Given binary tree [3,9,20,]]></description><category></category></item><item><title><![CDATA[算法作业HW17：LeetCode101 Symmetric Tree]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/73699739</link><guid>https://blog.youkuaiyun.com/as841175/article/details/73699739</guid><author>as841175</author><pubDate>Sun, 25 Jun 2017 10:52:30 +0800</pubDate><description><![CDATA[Description:



Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

For example, this binary tree [1,2,2,3,4,4,3] is symmetric:


 

 

Note:
]]></description><category></category></item><item><title><![CDATA[算法作业HW16：LeetCode121 Best Time to Buy and Sell Stock]]></title><link>https://blog.youkuaiyun.com/as841175/article/details/73087593</link><guid>https://blog.youkuaiyun.com/as841175/article/details/73087593</guid><author>as841175</author><pubDate>Mon, 12 Jun 2017 09:31:42 +0800</pubDate><description><![CDATA[Description:
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]]></description><category></category></item></channel></rss>