Skip to content

Commit 2a16431

Browse files
authored
Merge pull request #128 from halfrost/add_toc
Add toc
2 parents 87c5b40 + 9347140 commit 2a16431

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

website/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ disablePathToLower = true
8080
# (Optional, default true) Controls table of contents visibility on right side of pages.
8181
# Start and end levels can be controlled with markup.tableOfContents setting.
8282
# You can also specify this parameter per page in front matter.
83-
BookToC = false
83+
BookToC = true
8484

8585
# (Optional, default none) Set the path to a logo for the book. If the logo is
8686
# /static/logo.png then the path would be logo.png

website/content/ChapterOne/Time_Complexity.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ weight: 3
2727
|8|10^9|O(sqrt(n))|筛素数、求平方根|
2828
|9|10^10|O(log n)|二分搜索|
2929
|10|+∞|O(1)|数学相关算法|
30-
|----------------|----------------|------------------------------------------------------------------|--------------------------------|
30+
|------------------------------|------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|
3131

3232

3333
一些具有迷惑性的例子:
3434

3535
```c
3636
void hello (int n){
37-
3837
for( int sz = 1 ; sz < n ; sz += sz)
3938
for( int i = 1 ; i < n ; i ++)
4039
cout << "Hello" << endl;
@@ -45,7 +44,6 @@ void hello (int n){
4544
4645
```c
4746
bool isPrime (int n){
48-
4947
for( int x = 2 ; x * x <= n ; x ++ )
5048
if( n % x == 0)
5149
return false;
@@ -90,7 +88,7 @@ int sum( int n ){
9088

9189
## 三. 递归的时间复杂度
9290

93-
### 只有一次递归调用
91+
### 1. 只有一次递归调用
9492

9593
如果递归函数中,只进行了一次递归调用,且递归深度为 depth,在每个递归函数中,时间复杂度为 T,那么总体的时间复杂度为 O(T * depth)
9694

@@ -114,7 +112,7 @@ int binarySearch(int arr[], int l, int r, int target){
114112
在二分查找的递归实现中,只递归调用了自身。递归深度是 log n ,每次递归里面的复杂度是 O(1) 的,所以二分查找的递归实现的时间复杂度为 O(log n) 的。
115113
116114
117-
### 只有多次递归调用
115+
### 2. 只有多次递归调用
118116
119117
针对多次递归调用的情况,就需要看它的计算调用的次数了。通常可以画一颗递归树来看。举例:
120118

website/content/ChapterThree/Segment_Tree.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,13 @@ Range Sum Query 问题专门处理查询范围内的元素总和。这个问题
373373

374374

375375

376-
### 2. 单点更新:
376+
### 2. 单点更新
377377
- [HDU 1166 敌兵布阵](http://acm.hdu.edu.cn/showproblem.php?pid=1166) update:单点增减 query:区间求和
378378
- [HDU 1754 I Hate It](http://acm.hdu.edu.cn/showproblem.php?pid=1754) update:单点替换 query:区间最值
379379
- [HDU 1394 Minimum Inversion Number](http://acm.hdu.edu.cn/showproblem.php?pid=1394) update:单点增减 query:区间求和
380380
- [HDU 2795 Billboard](http://acm.hdu.edu.cn/showproblem.php?pid=2795) query:区间求最大值的位子(直接把update的操作在query里做了)
381381

382-
### 3. 区间更新:
382+
### 3. 区间更新
383383

384384
- [HDU 1698 Just a Hook](http://acm.hdu.edu.cn/showproblem.php?pid=1698) update:成段替换 (由于只query一次总区间,所以可以直接输出 1 结点的信息)
385385
- [POJ 3468 A Simple Problem with Integers](http://poj.org/problem?id=3468) update:成段增减 query:区间求和

website/resources/_gen/assets/scss/leetcode/book.scss_50fc8c04e12a2f59027287995557ceff.content

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"Target":"book.min.d72be39bb6c9e3940e62a4157008da6c9fb4e80dda8e9b692cbdab037c033a5a.css","MediaType":"text/css","Data":{"Integrity":"sha256-1yvjm7bJ45QOYqQVcAjabJ+06A3ajptpLL2rA3wDOlo="}}
1+
{"Target":"book.min.fcdb1f07040371dc4d234f40698d15b7fb50f2dc9982bcd0898d9806ff4e07f8.css","MediaType":"text/css","Data":{"Integrity":"sha256-/NsfBwQDcdxNI09AaY0Vt/tQ8tyZgrzQiY2YBv9OB/g="}}

website/themes/book/assets/_main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ ul.pagination {
214214
}
215215

216216
.book-toc {
217-
flex: 0 0 $toc-width;
217+
// flex: 0 0 $toc-width; // 使 toc 靠右贴边
218218
font-size: $font-size-12;
219219

220220
.book-toc-content {

0 commit comments

Comments
 (0)