<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Rewind_L的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Rewind_L</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Rewind_L]]></copyright><item><title><![CDATA[LeetCode.365.水壶问题]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/105012200</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/105012200</guid><author>Rewind_L</author><pubDate>Sat, 21 Mar 2020 16:38:21 +0800</pubDate><description><![CDATA[题目：

两个容量分别为x升和y升的水壶盛出z升水。



解答：

链接：力扣官方题解

思路一：DFS

思路二：代数方法（贝祖定理）
]]></description><category></category></item><item><title><![CDATA[【MATLAB】构建WS小世界网络]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/88736205</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/88736205</guid><author>Rewind_L</author><pubDate>Fri, 22 Mar 2019 14:16:01 +0800</pubDate><description><![CDATA[分析：

进行复杂网络相关研究的基础，就是要构建适当的网络模型。这次选择用Matlab构建一个WS小世界网络练练手。

首先，为了方便数据处理，网络模型我们用邻接矩阵的表示，这样虽然看上去不太直观，但是对于矩阵运算是很友好的。

小世界网络分为两种：NW小世界网络和WS小世界网络。它们的构造都基于一个初试的最近邻耦合网络A：也就是网络中每个节点都与左右相邻的各K/2个节点相连，其中参数K满足N&g...]]></description><category></category></item><item><title><![CDATA[[NP] 8.9]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/74923274</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/74923274</guid><author>Rewind_L</author><pubDate>Mon, 10 Jul 2017 15:01:59 +0800</pubDate><description><![CDATA[题目：

题目分析：
1、对于这个题目的理解：即对一组集合，要求找出规模在b以内的和每一个集合Si有交集的集合H。
2、要证明该问题是一个NP问题，首先要验证对于任意一个假定的答案H是否符合问题对答案的要求，这里就对任意一个答案H作出分析：
     1）对于集合H，首先判定起规模是否为b以内，这个步骤耗时为min（b，H.size()）；
     2）其次利用遍历对每一个Si的元素]]></description><category></category></item><item><title><![CDATA[[DP]516. Longest Palindromic Subsequence]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/72904613</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/72904613</guid><author>Rewind_L</author><pubDate>Wed, 07 Jun 2017 22:23:46 +0800</pubDate><description><![CDATA[题目：
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.

Example 1:
Input: 
"bbbab"

Output:
4

One possible longest ]]></description><category></category></item><item><title><![CDATA[[DP]392. Is Subsequence]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/72804790</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/72804790</guid><author>Rewind_L</author><pubDate>Mon, 29 May 2017 22:39:54 +0800</pubDate><description><![CDATA[题目：
Given a string s and a string t, check if 
s is subsequence of t. 
You may assume that there is only lower case English letters in both s and
t. t is potentially a very long (length ~= 500,000]]></description><category></category></item><item><title><![CDATA[[DP]343. Integer Break]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/72793779</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/72793779</guid><author>Rewind_L</author><pubDate>Sun, 28 May 2017 17:04:25 +0800</pubDate><description><![CDATA[题目：
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.

For example, given n = 2]]></description><category></category></item><item><title><![CDATA[[DP]357. Count Numbers with Unique Digits]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/72630342</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/72630342</guid><author>Rewind_L</author><pubDate>Mon, 22 May 2017 21:29:04 +0800</pubDate><description><![CDATA[题目：

Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.
Example:
Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100, e]]></description><category></category></item><item><title><![CDATA[[DP]413. Arithmetic Slices]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/72123452</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/72123452</guid><author>Rewind_L</author><pubDate>Mon, 15 May 2017 10:54:54 +0800</pubDate><description><![CDATA[题目：


A 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.
For example, these are arithmetic ]]></description><category></category></item><item><title><![CDATA[[DP]486. Predict the Winner]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/71453583</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/71453583</guid><author>Rewind_L</author><pubDate>Tue, 09 May 2017 13:57:08 +0800</pubDate><description><![CDATA[题目：
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player pi]]></description><category></category></item><item><title><![CDATA[[DP]338. Counting Bits]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/71105898</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/71105898</guid><author>Rewind_L</author><pubDate>Wed, 03 May 2017 00:21:18 +0800</pubDate><description><![CDATA[题目：
Given a non negative integer number num. For every numbers 
i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.
Example:
For num]]></description><category></category></item><item><title><![CDATA[[BFS]101. Symmetric Tree]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/70733340</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/70733340</guid><author>Rewind_L</author><pubDate>Tue, 25 Apr 2017 12:24:59 +0800</pubDate><description><![CDATA[题目：

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: 
    1
   / \
  2   2
 / \ / \
3  4 ]]></description><category></category></item><item><title><![CDATA[[BFS]102. Binary Tree Level Order Traversal]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/70700393</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/70700393</guid><author>Rewind_L</author><pubDate>Tue, 25 Apr 2017 11:34:23 +0800</pubDate><description><![CDATA[题目：

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree [3,9,20,null,null,15,7],

    3
   / \
 ]]></description><category></category></item><item><title><![CDATA[[BFS]107. Binary Tree Level Order Traversal II]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/70228413</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/70228413</guid><author>Rewind_L</author><pubDate>Tue, 18 Apr 2017 14:52:52 +0800</pubDate><description><![CDATA[题目：

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree [3,9,20,null,n]]></description><category></category></item><item><title><![CDATA[[BFS]199. Binary Tree Right Side View]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/70037414</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/70037414</guid><author>Rewind_L</author><pubDate>Mon, 10 Apr 2017 21:20:38 +0800</pubDate><description><![CDATA[题目：

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tree,
]]></description><category></category></item><item><title><![CDATA[[BFS]529. Minesweeper]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/68958197</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/68958197</guid><author>Rewind_L</author><pubDate>Mon, 03 Apr 2017 12:27:27 +0800</pubDate><description><![CDATA[【记又一次阵亡在“==”上的惨痛经历】
题目：

Let's play the minesweeper game (Wikipedia,
online game)!

You are given a 2D char matrix representing the game board. 'M' represents an
unrevealed mine, 'E' represents]]></description><category></category></item><item><title><![CDATA[[DFS]515. Find Largest Value in Each Tree Row]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/67633004</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/67633004</guid><author>Rewind_L</author><pubDate>Tue, 28 Mar 2017 10:43:12 +0800</pubDate><description><![CDATA[题目：

题目分析：
1、题目要求通过给出的二叉树找出每行最大值。最后通过一个容器返回所有结果。
2、这里注意找的是每一行的最大值，我们知道对于一个数组而言，最大值仅需遍历一遍即可；那么我们把每棵树当作若干数组的堆叠，仅需对每层进行一次遍历即可。很显然层序遍历的方法就是BFS。
3、明确了通过BFS求解后，还需要解决细节上的问题。比如，在BFS的队列实现中，如何找到各层的起始和终止位置。]]></description><category></category></item><item><title><![CDATA[【讨论_图论】DFS问题（一）]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/64472714</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/64472714</guid><author>Rewind_L</author><pubDate>Tue, 21 Mar 2017 18:53:52 +0800</pubDate><description><![CDATA[原问题（算法概论P99 3.22）Give an efficient algorithm that takes as input a directed acyclic graph G = {V, E}, and determines whether or not there is a vertex s ∈ V from which all other vertices are reachable.]]></description><category></category></item><item><title><![CDATA[[DFS]513. Find Bottom Left Tree Value]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/63707513</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/63707513</guid><author>Rewind_L</author><pubDate>Sun, 19 Mar 2017 21:34:03 +0800</pubDate><description><![CDATA[题目：

Given a binary tree, find the leftmost value in the last row of the tree.

Example 1:


Input:

    2
   / \
  1   3

Output:
1




Example 2: 


Input:

        1
       / \
      2   3
     / ...]]></description><category></category></item><item><title><![CDATA[[Divide and Conquer]240. Search a 2D Matrix II]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/61693984</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/61693984</guid><author>Rewind_L</author><pubDate>Sun, 12 Mar 2017 23:30:46 +0800</pubDate><description><![CDATA[题目：

1、本题中给出的矩阵具有行列向均递增的特性，且矩阵由二重容器表示。要求检验元素target是否在矩阵当中。
2、算法
①最基本的算法为二重循环遍历一次矩阵即可，但是这样并没有用上矩阵行列递增的特点，算法复杂度达到了O(mn)，这里考虑用更简单的办法解决之。
②第二种算法考虑沿着矩阵对角线前进以节省时间。从matrix[0][0]出发，若比target小则i++，j++，如此循环]]></description><category></category></item><item><title><![CDATA[[Divide and Conquer]241. Different Ways to Add Parentheses]]></title><link>https://blog.youkuaiyun.com/Rewind_L/article/details/61618986</link><guid>https://blog.youkuaiyun.com/Rewind_L/article/details/61618986</guid><author>Rewind_L</author><pubDate>Sun, 12 Mar 2017 15:44:38 +0800</pubDate><description><![CDATA[题目：



题目分析：

1、根据题目要求，函数的输入为一个只涉及"+"、"-"、"×"三种运算的字符串。需要根据输入计算出所有可能计算顺序所对应的结果，并返回包含所有答案的Vector（升序）。

2、问题一：怎么才能算出所有可能的顺序呢？

很明显如果按照排列组合的方式依次添加括号，再利用栈的计算方法得出结果，涉及的代码量巨大且容易出错和遗漏。这里考虑用分治（递归）的方法解决；

假设一个字...]]></description><category></category></item></channel></rss>