Skip to content

Commit d6ab997

Browse files
author
yzz
committed
dp
1 parent 376a7c2 commit d6ab997

20 files changed

Lines changed: 981 additions & 62 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<meta property="og:type" content="website" />
2020
<meta property="og:url" content="https://sin-coder.github.io/" />
2121

22-
<meta property="og:updated_time" content="2020-02-20T22:31:32+08:00" />
22+
<meta property="og:updated_time" content="2020-02-25T20:44:56+08:00" />
2323

2424

2525
</head>

index.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>Recent content on sin-coder</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Thu, 20 Feb 2020 22:31:32 +0800</lastBuildDate>
9+
<lastBuildDate>Tue, 25 Feb 2020 20:44:56 +0800</lastBuildDate>
1010

1111
<atom:link href="https://sin-coder.github.io/index.xml" rel="self" type="application/rss+xml" />
1212

@@ -413,6 +413,15 @@ MapReduce(离线处理)-----》Spark(高性能批处理技术)------》Storm(流
413413
C:\Users\Administrator&amp;gt;hugo new site E:\hugo\Sites\myblog Congratulations! Your new Hugo site is created in E:\hugo\Sites\myblog.</description>
414414
</item>
415415

416+
<item>
417+
<title>Pycollect</title>
418+
<link>https://sin-coder.github.io/program/pycollect/</link>
419+
<pubDate>Tue, 25 Feb 2020 20:44:56 +0800</pubDate>
420+
421+
<guid>https://sin-coder.github.io/program/pycollect/</guid>
422+
<description></description>
423+
</item>
424+
416425
<item>
417426
<title>Git向Github push时,连接超时</title>
418427
<link>https://sin-coder.github.io/post/git%E8%BF%9E%E6%8E%A5github%E5%A4%B1%E8%B4%A5/</link>
@@ -631,6 +640,19 @@ GFS系统的优点:高可用性、自动负载均衡
631640
</description>
632641
</item>
633642

643+
<item>
644+
<title>动态规划解题思想总结</title>
645+
<link>https://sin-coder.github.io/leetcode/dp/</link>
646+
<pubDate>Tue, 03 Dec 2019 22:26:15 +0800</pubDate>
647+
648+
<guid>https://sin-coder.github.io/leetcode/dp/</guid>
649+
<description>动态规划解题思想总结 一、动态规划和递归、分治的关系 1.递归 关于递归其实就是一个函数调用它自己,它和分治和回溯等算法没有完全隔离开来,它们都可以看做是
650+
描述一个问题的不同方面。使用递归方法解题时都是有模板的:
651+
public void recur(int level,int param){ //terminator if(level &amp;gt; MAX_LEVEL){ //process result return; } //process current logic process(level,param); //drill down recur(level:level + 1,newParam) //restore current status } 这里上一道经典的使用递归解决的算法题来说明这个框架的使用
652+
经典的汉诺塔问题:原题链接
653+
public void hanota(List&amp;lt;Integer&amp;gt; A, List&amp;lt;Integer&amp;gt; B, List&amp;lt;Integer&amp;gt; C) { int len = A.size(); //汉诺塔的数量 Hanota(len,A,B,C); } //递归函数 public void Hanota(int n,List&amp;lt;Integer&amp;gt; X,List&amp;lt;Integer&amp;gt; Y,List&amp;lt;Integer&amp;gt; Z){ if(n == 1){ //终止条件 Z.add(0,X.remove(0)); //处理结果 }else{ Hanota(n - 1,X,Z,Y); //向下递归 Z.</description>
654+
</item>
655+
634656
<item>
635657
<title>Java和Python中如何使用大顶堆</title>
636658
<link>https://sin-coder.github.io/program/javapqueue/</link>

leetcode/dp/index.html

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

leetcode/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ <h1>Leetcodes</h1>
7272
</span>
7373
</li>
7474

75+
<li class="posts-list-item">
76+
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/dp/">动态规划解题思想总结</a>
77+
<span class="posts-list-item-description">
78+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
79+
<title>clock</title>
80+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
81+
</svg> 4 min read -
82+
Dec 3, 2019
83+
</span>
84+
</li>
85+
7586
<li class="posts-list-item">
7687
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/greedy/">贪心算法集锦</a>
7788
<span class="posts-list-item-description">

leetcode/index.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@
3333
//构建一个哈希表用来存放每个元素及其出现的频率 private HashMap&amp;lt;Integer,Integer&amp;gt; map = new HashMap(); //构建一个小顶堆,并且该堆要对map中的元素出现的频率进行排序 private PriorityQueue&amp;lt;Integer&amp;gt; heap = new PriorityQueue&amp;lt;&amp;gt;((n1,n2) -&amp;gt; map.get(n1) map.get(n2)); //返回的列表 private List&amp;lt;Integer&amp;gt; topK = new LinkedList(); public List&amp;lt;Integer&amp;gt; topKFrequent(int[] nums, int k) { //先统计每个元素及其出现的频率,当然还有更简单的写法,请看拓展内容 for(int n : nums){ if(map.</description>
3434
</item>
3535

36+
<item>
37+
<title>动态规划解题思想总结</title>
38+
<link>https://sin-coder.github.io/leetcode/dp/</link>
39+
<pubDate>Tue, 03 Dec 2019 22:26:15 +0800</pubDate>
40+
41+
<guid>https://sin-coder.github.io/leetcode/dp/</guid>
42+
<description>动态规划解题思想总结 一、动态规划和递归、分治的关系 1.递归 关于递归其实就是一个函数调用它自己,它和分治和回溯等算法没有完全隔离开来,它们都可以看做是
43+
描述一个问题的不同方面。使用递归方法解题时都是有模板的:
44+
public void recur(int level,int param){ //terminator if(level &amp;gt; MAX_LEVEL){ //process result return; } //process current logic process(level,param); //drill down recur(level:level + 1,newParam) //restore current status } 这里上一道经典的使用递归解决的算法题来说明这个框架的使用
45+
经典的汉诺塔问题:原题链接
46+
public void hanota(List&amp;lt;Integer&amp;gt; A, List&amp;lt;Integer&amp;gt; B, List&amp;lt;Integer&amp;gt; C) { int len = A.size(); //汉诺塔的数量 Hanota(len,A,B,C); } //递归函数 public void Hanota(int n,List&amp;lt;Integer&amp;gt; X,List&amp;lt;Integer&amp;gt; Y,List&amp;lt;Integer&amp;gt; Z){ if(n == 1){ //终止条件 Z.add(0,X.remove(0)); //处理结果 }else{ Hanota(n - 1,X,Z,Y); //向下递归 Z.</description>
47+
</item>
48+
3649
<item>
3750
<title>贪心算法集锦</title>
3851
<link>https://sin-coder.github.io/leetcode/greedy/</link>

page/2/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<meta property="og:type" content="website" />
2020
<meta property="og:url" content="https://sin-coder.github.io/" />
2121

22-
<meta property="og:updated_time" content="2020-02-20T22:31:32+08:00" />
22+
<meta property="og:updated_time" content="2020-02-25T20:44:56+08:00" />
2323

2424

2525
</head>
@@ -94,6 +94,17 @@ <h1>sin-coder</h1>
9494
</span>
9595
</li>
9696

97+
<li class="posts-list-item">
98+
<a class="posts-list-item-title" href="https://sin-coder.github.io/program/pycollect/">Pycollect</a>
99+
<span class="posts-list-item-description">
100+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
101+
<title>clock</title>
102+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
103+
</svg> 0 min read -
104+
Feb 25, 2020
105+
</span>
106+
</li>
107+
97108
<li class="posts-list-item">
98109
<a class="posts-list-item-title" href="https://sin-coder.github.io/post/git%E8%BF%9E%E6%8E%A5github%E5%A4%B1%E8%B4%A5/">Git向Github push时,连接超时</a>
99110
<span class="posts-list-item-description">
@@ -160,17 +171,6 @@ <h1>sin-coder</h1>
160171
</span>
161172
</li>
162173

163-
<li class="posts-list-item">
164-
<a class="posts-list-item-title" href="https://sin-coder.github.io/category/content/">技术博客分类目录</a>
165-
<span class="posts-list-item-description">
166-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
167-
<title>clock</title>
168-
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
169-
</svg> 1 min read -
170-
Dec 20, 2019
171-
</span>
172-
</li>
173-
174174
</ul>
175175

176176

page/3/index.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<meta property="og:type" content="website" />
2020
<meta property="og:url" content="https://sin-coder.github.io/" />
2121

22-
<meta property="og:updated_time" content="2020-02-20T22:31:32+08:00" />
22+
<meta property="og:updated_time" content="2020-02-25T20:44:56+08:00" />
2323

2424

2525
</head>
@@ -61,6 +61,17 @@ <h3><a href="/personal/introduce/" title="首页">个人简介</a></h3>
6161
<h1>sin-coder</h1>
6262
<ul class="posts-list">
6363

64+
<li class="posts-list-item">
65+
<a class="posts-list-item-title" href="https://sin-coder.github.io/category/content/">技术博客分类目录</a>
66+
<span class="posts-list-item-description">
67+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
68+
<title>clock</title>
69+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
70+
</svg> 1 min read -
71+
Dec 20, 2019
72+
</span>
73+
</li>
74+
6475
<li class="posts-list-item">
6576
<a class="posts-list-item-title" href="https://sin-coder.github.io/personal/introduce/">技术成长之路</a>
6677
<span class="posts-list-item-description">
@@ -94,6 +105,17 @@ <h1>sin-coder</h1>
94105
</span>
95106
</li>
96107

108+
<li class="posts-list-item">
109+
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/dp/">动态规划解题思想总结</a>
110+
<span class="posts-list-item-description">
111+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
112+
<title>clock</title>
113+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
114+
</svg> 4 min read -
115+
Dec 3, 2019
116+
</span>
117+
</li>
118+
97119
<li class="posts-list-item">
98120
<a class="posts-list-item-title" href="https://sin-coder.github.io/program/javapqueue/">Java和Python中如何使用大顶堆</a>
99121
<span class="posts-list-item-description">
@@ -149,28 +171,6 @@ <h1>sin-coder</h1>
149171
</span>
150172
</li>
151173

152-
<li class="posts-list-item">
153-
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/printlistreverse/">从尾到头打印链表</a>
154-
<span class="posts-list-item-description">
155-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
156-
<title>clock</title>
157-
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
158-
</svg> 2 min read -
159-
Nov 15, 2019
160-
</span>
161-
</li>
162-
163-
<li class="posts-list-item">
164-
<a class="posts-list-item-title" href="https://sin-coder.github.io/datastructure/defindatastructure/">常见数据结构的定义</a>
165-
<span class="posts-list-item-description">
166-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
167-
<title>clock</title>
168-
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
169-
</svg> 1 min read -
170-
Nov 15, 2019
171-
</span>
172-
</li>
173-
174174
</ul>
175175

176176

page/4/index.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<meta property="og:type" content="website" />
2020
<meta property="og:url" content="https://sin-coder.github.io/" />
2121

22-
<meta property="og:updated_time" content="2020-02-20T22:31:32+08:00" />
22+
<meta property="og:updated_time" content="2020-02-25T20:44:56+08:00" />
2323

2424

2525
</head>
@@ -61,6 +61,28 @@ <h3><a href="/personal/introduce/" title="首页">个人简介</a></h3>
6161
<h1>sin-coder</h1>
6262
<ul class="posts-list">
6363

64+
<li class="posts-list-item">
65+
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/printlistreverse/">从尾到头打印链表</a>
66+
<span class="posts-list-item-description">
67+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
68+
<title>clock</title>
69+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
70+
</svg> 2 min read -
71+
Nov 15, 2019
72+
</span>
73+
</li>
74+
75+
<li class="posts-list-item">
76+
<a class="posts-list-item-title" href="https://sin-coder.github.io/datastructure/defindatastructure/">常见数据结构的定义</a>
77+
<span class="posts-list-item-description">
78+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
79+
<title>clock</title>
80+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
81+
</svg> 1 min read -
82+
Nov 15, 2019
83+
</span>
84+
</li>
85+
6486
<li class="posts-list-item">
6587
<a class="posts-list-item-title" href="https://sin-coder.github.io/leetcode/circlelist/">环形链表</a>
6688
<span class="posts-list-item-description">

program/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<meta property="og:type" content="website" />
2020
<meta property="og:url" content="https://sin-coder.github.io/program/" />
2121

22-
<meta property="og:updated_time" content="2019-12-03T21:14:28+08:00" />
22+
<meta property="og:updated_time" content="2020-02-25T20:44:56+08:00" />
2323

2424

2525
</head>
@@ -61,6 +61,17 @@ <h3><a href="/personal/introduce/" title="首页">个人简介</a></h3>
6161
<h1>Programs</h1>
6262
<ul class="posts-list">
6363

64+
<li class="posts-list-item">
65+
<a class="posts-list-item-title" href="https://sin-coder.github.io/program/pycollect/">Pycollect</a>
66+
<span class="posts-list-item-description">
67+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
68+
<title>clock</title>
69+
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
70+
</svg> 0 min read -
71+
Feb 25, 2020
72+
</span>
73+
</li>
74+
6475
<li class="posts-list-item">
6576
<a class="posts-list-item-title" href="https://sin-coder.github.io/program/javapqueue/">Java和Python中如何使用大顶堆</a>
6677
<span class="posts-list-item-description">

program/index.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
<description>Recent content in Programs on sin-coder</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Tue, 03 Dec 2019 21:14:28 +0800</lastBuildDate>
9+
<lastBuildDate>Tue, 25 Feb 2020 20:44:56 +0800</lastBuildDate>
1010

1111
<atom:link href="https://sin-coder.github.io/program/index.xml" rel="self" type="application/rss+xml" />
1212

1313

14+
<item>
15+
<title>Pycollect</title>
16+
<link>https://sin-coder.github.io/program/pycollect/</link>
17+
<pubDate>Tue, 25 Feb 2020 20:44:56 +0800</pubDate>
18+
19+
<guid>https://sin-coder.github.io/program/pycollect/</guid>
20+
<description></description>
21+
</item>
22+
1423
<item>
1524
<title>Java和Python中如何使用大顶堆</title>
1625
<link>https://sin-coder.github.io/program/javapqueue/</link>

0 commit comments

Comments
 (0)