Skip to content

Commit 7243d49

Browse files
committed
Deployed a09513a with MkDocs version: 1.0.4
1 parent d9f6027 commit 7243d49

31 files changed

+37
-39
lines changed

.DS_Store

-6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

03_链表/lru_cache.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def __call__(self, func):
9494
9595
- 这里为了简化默认参数只有一个数字 n,假如可以传入多个参数,如何确定缓存的key 呢?
9696
- 这里实现没有考虑线程安全的问题,要如何才能实现线程安全的 LRU 呢?当然如果不是多线程环境下使用是不需要考虑的
97-
- 假如这里没有用内置的 dict,你能使用 redis 来实现这个 LRU 吗,如果使用了 redis,我们可以存储更多数据到服务器。而使用字典实际上是换到到了Python进程里(localCache)。
97+
- 假如这里没有用内置的 dict,你能使用 redis 来实现这个 LRU 吗,如果使用了 redis,我们可以存储更多数据到服务器。而使用字典实际上是缓存了Python进程里(localCache)。
98+
- 这里只是实现了 lru 策略,你能同时实现一个超时 timeout 参数吗?比如像是memcache 实现的 lazy expiration 策略
99+
- LRU有个缺点就是,对于周期性的数据访问会导致命中率迅速下降,有一种优化是 LRU-K,访问了次数达到 k 次才会将数据放入缓存
98100
"""
99101
def _(n):
100102
if n in self.od:
@@ -125,5 +127,7 @@ def test():
125127
print(time.time() - beg)
126128

127129

130+
# TODO 要怎么给 lru 写单测?
131+
128132
if __name__ == '__main__':
129133
test()

03_链表/wnntest.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
-6.74 KB
Binary file not shown.
-8.47 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

14_树与二叉树/btree.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def preorder_trav_use_stack(self, subtree):
7272
if subtree:
7373
s.push(subtree)
7474
while not s.empty():
75-
peek = s.pop()
76-
print(peek.data) # 注意这里我用了 print,你可以用 yield 产出值然后在调用的地方转成 list
77-
if peek.right:
78-
s.push(peek.right)
79-
if peek.left:
80-
s.push(peek.left)
75+
top_node = s.pop()
76+
print(top_node.data) # 注意这里我用了 print,你可以用 yield 产出值然后在调用的地方转成 list
77+
if top_node.right:
78+
s.push(top_node.right)
79+
if top_node.left:
80+
s.push(top_node.left)
8181

8282
def inorder_trav(self, subtree):
8383
if subtree is not None:
Binary file not shown.
Binary file not shown.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,5 +581,5 @@ <h2 id="_21">本电子书制作和写作方式</h2>
581581

582582
<!--
583583
MkDocs version : 1.0.4
584-
Build Date UTC : 2018-12-23 10:36:51
584+
Build Date UTC : 2018-12-24 02:34:11
585585
-->

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

sitemap.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,122 +2,122 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>None</loc>
5-
<lastmod>2018-12-23</lastmod>
5+
<lastmod>2018-12-24</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>None</loc>
10-
<lastmod>2018-12-23</lastmod>
10+
<lastmod>2018-12-24</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
<url>
1414
<loc>None</loc>
15-
<lastmod>2018-12-23</lastmod>
15+
<lastmod>2018-12-24</lastmod>
1616
<changefreq>daily</changefreq>
1717
</url>
1818
<url>
1919
<loc>None</loc>
20-
<lastmod>2018-12-23</lastmod>
20+
<lastmod>2018-12-24</lastmod>
2121
<changefreq>daily</changefreq>
2222
</url>
2323
<url>
2424
<loc>None</loc>
25-
<lastmod>2018-12-23</lastmod>
25+
<lastmod>2018-12-24</lastmod>
2626
<changefreq>daily</changefreq>
2727
</url>
2828
<url>
2929
<loc>None</loc>
30-
<lastmod>2018-12-23</lastmod>
30+
<lastmod>2018-12-24</lastmod>
3131
<changefreq>daily</changefreq>
3232
</url>
3333
<url>
3434
<loc>None</loc>
35-
<lastmod>2018-12-23</lastmod>
35+
<lastmod>2018-12-24</lastmod>
3636
<changefreq>daily</changefreq>
3737
</url>
3838
<url>
3939
<loc>None</loc>
40-
<lastmod>2018-12-23</lastmod>
40+
<lastmod>2018-12-24</lastmod>
4141
<changefreq>daily</changefreq>
4242
</url>
4343
<url>
4444
<loc>None</loc>
45-
<lastmod>2018-12-23</lastmod>
45+
<lastmod>2018-12-24</lastmod>
4646
<changefreq>daily</changefreq>
4747
</url>
4848
<url>
4949
<loc>None</loc>
50-
<lastmod>2018-12-23</lastmod>
50+
<lastmod>2018-12-24</lastmod>
5151
<changefreq>daily</changefreq>
5252
</url>
5353
<url>
5454
<loc>None</loc>
55-
<lastmod>2018-12-23</lastmod>
55+
<lastmod>2018-12-24</lastmod>
5656
<changefreq>daily</changefreq>
5757
</url>
5858
<url>
5959
<loc>None</loc>
60-
<lastmod>2018-12-23</lastmod>
60+
<lastmod>2018-12-24</lastmod>
6161
<changefreq>daily</changefreq>
6262
</url>
6363
<url>
6464
<loc>None</loc>
65-
<lastmod>2018-12-23</lastmod>
65+
<lastmod>2018-12-24</lastmod>
6666
<changefreq>daily</changefreq>
6767
</url>
6868
<url>
6969
<loc>None</loc>
70-
<lastmod>2018-12-23</lastmod>
70+
<lastmod>2018-12-24</lastmod>
7171
<changefreq>daily</changefreq>
7272
</url>
7373
<url>
7474
<loc>None</loc>
75-
<lastmod>2018-12-23</lastmod>
75+
<lastmod>2018-12-24</lastmod>
7676
<changefreq>daily</changefreq>
7777
</url>
7878
<url>
7979
<loc>None</loc>
80-
<lastmod>2018-12-23</lastmod>
80+
<lastmod>2018-12-24</lastmod>
8181
<changefreq>daily</changefreq>
8282
</url>
8383
<url>
8484
<loc>None</loc>
85-
<lastmod>2018-12-23</lastmod>
85+
<lastmod>2018-12-24</lastmod>
8686
<changefreq>daily</changefreq>
8787
</url>
8888
<url>
8989
<loc>None</loc>
90-
<lastmod>2018-12-23</lastmod>
90+
<lastmod>2018-12-24</lastmod>
9191
<changefreq>daily</changefreq>
9292
</url>
9393
<url>
9494
<loc>None</loc>
95-
<lastmod>2018-12-23</lastmod>
95+
<lastmod>2018-12-24</lastmod>
9696
<changefreq>daily</changefreq>
9797
</url>
9898
<url>
9999
<loc>None</loc>
100-
<lastmod>2018-12-23</lastmod>
100+
<lastmod>2018-12-24</lastmod>
101101
<changefreq>daily</changefreq>
102102
</url>
103103
<url>
104104
<loc>None</loc>
105-
<lastmod>2018-12-23</lastmod>
105+
<lastmod>2018-12-24</lastmod>
106106
<changefreq>daily</changefreq>
107107
</url>
108108
<url>
109109
<loc>None</loc>
110-
<lastmod>2018-12-23</lastmod>
110+
<lastmod>2018-12-24</lastmod>
111111
<changefreq>daily</changefreq>
112112
</url>
113113
<url>
114114
<loc>None</loc>
115-
<lastmod>2018-12-23</lastmod>
115+
<lastmod>2018-12-24</lastmod>
116116
<changefreq>daily</changefreq>
117117
</url>
118118
<url>
119119
<loc>None</loc>
120-
<lastmod>2018-12-23</lastmod>
120+
<lastmod>2018-12-24</lastmod>
121121
<changefreq>daily</changefreq>
122122
</url>
123123
</urlset>

sitemap.xml.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)