- 博客(9)
- 收藏
- 关注
原创 算法概率8.12 k生成树问题
8.12 k-生成树问题输入:无向图G=(V,E),输出:G的一个生成树,其中所有点度数不超过k——如果这样的树存在。 给定K大于等于2。题目a:k-生成树问题是一个搜索问题。 题目b:k-生成树问题是NP-完全的。(提示:由k=2开始,考虑与Rudrata路径问题的关联)a:验证任意给定解S是否是k生成树的过程,只需要用图搜索算法对S进行搜索,如果S中
2017-01-15 17:09:24 436
原创 LeetCode Learning 7
198. House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them
2016-12-27 23:59:34 225
原创 LeetCode Learning 6
62. Unique PathsA robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot i
2016-11-14 21:32:06 157
原创 LeetCode Learning 5
这次挑选了2道与动态规划有关的问题。64. Minimum Path Sum.Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
2016-11-06 21:46:44 183
原创 LeetCode Learning 4
413. Arithmetic SlicesA sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.A zero-indexed
2016-10-26 23:26:12 176
原创 LeetCode Learning 3
这次选了2题easy难度的题和1道normal难度的题。2题easy都是关于字符串处理的,有相似之处所以一起写出来,加以对比。389. Find the DifferenceGiven two strings s and t which consist of only lowercase letters.String t is generated by random
2016-09-21 21:47:31 375
原创 LeetCode Learning 2
292.Nim GameDifficulty:Easy题目具体如下:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The
2016-09-17 22:39:48 168
原创 LeetCode Learning 1
第一次在林老师推荐的LeetCode这个网站上做题。先挑了几题通过率比较高的简单题和中等题来尝试。首先第一题是
2016-09-04 15:54:41 205
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人