Skip to content

Commit

Permalink
增加章节锚点
Browse files Browse the repository at this point in the history
  • Loading branch information
diguage committed Jun 21, 2024
1 parent d9480df commit 7161169
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/0000-00-overview.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[#0000-overview]
[#overview]
= 总览

思考题:如何用代码实现针对代码计算其时间复杂度?
Expand Down
2 changes: 1 addition & 1 deletion docs/0000-01-sliding-window.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[#0000-01-sliding-window]
[#sliding-window]
= 滑动窗口算法

滑动窗口类型的题目经常是用来执行数组或是链表上某个区间(窗口)上的操作。比如找最长的全为1的子数组长度。滑动窗口一般从第一个元素开始,一直往右边一个一个元素挪动。当然了,根据题目要求,我们可能有固定窗口大小的情况,也有窗口的大小变化的情况。
Expand Down
4 changes: 2 additions & 2 deletions docs/0000-02-two-pointer.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[#0000-backtrack]
[#two-pointer]
= Two Pointer

. 76. Minimum Window Substring
Expand Down Expand Up @@ -60,4 +60,4 @@ LeetCode 1124. Longest Well-Performing Interval (medium)

== 参考资料

. http://joshuablog.herokuapp.com/Two-Pointer%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93.html[Two Pointer问题总结 | Joshua]
. http://joshuablog.herokuapp.com/Two-Pointer%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93.html[Two Pointer问题总结 | Joshua]
3 changes: 2 additions & 1 deletion docs/0000-03-fast-slow-pointers.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#fast-slow-pointers]
= Fast & Slow pointers, 快慢指针类型

这种模式,有一个非常出门的名字,叫龟兔赛跑。咱们肯定都知道龟兔赛跑啦。但还是再解释一下快慢指针:这种算法的两个指针的在数组上(或是链表上,序列上)的移动速度不一样。还别说,这种方法在解决有环的链表和数组时特别有用。
Expand All @@ -19,4 +20,4 @@ Start of LinkedList Cycle (medium)

Happy Number (medium)

Middle of the LinkedList (easy)
Middle of the LinkedList (easy)
3 changes: 2 additions & 1 deletion docs/0000-04-merge-intervals.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#merge-intervals]
= Merge Intervals,区间合并类型


Expand All @@ -17,4 +18,4 @@ Insert Interval (medium)

Intervals Intersection (medium)

Conflicting Appointments (medium)
Conflicting Appointments (medium)
3 changes: 2 additions & 1 deletion docs/0000-05-cyclic-sort.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#cyclic-sort]
= Cyclic Sort,循环排序

这种模式讲述的是一直很好玩的方法:可以用来处理数组中的数值限定在一定的区间的问题。这种模式一个个遍历数组中的元素,如果当前这个数它不在其应该在的位置的话,咱们就把它和它应该在的那个位置上的数交换一下。你可以尝试将该数放到其正确的位置上,但这复杂度就会是O(n^2^)。这样的话,可能就不是最优解了。因此循环排序的优势就体现出来了。
Expand All @@ -15,4 +16,4 @@ Find all Missing Numbers (easy)

Find the Duplicate Number (easy)

Find all Duplicate Numbers (easy)
Find all Duplicate Numbers (easy)
3 changes: 2 additions & 1 deletion docs/0000-06-reversed-list.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#reversed-list]
= In-place Reversal of a LinkedList,链表翻转

在众多问题中,题目可能需要你去翻转链表中某一段的节点。通常,要求都是你得原地翻转,就是重复使用这些已经建好的节点,而不使用额外的空间。这个时候,原地翻转模式就要发挥威力了。
Expand All @@ -14,4 +15,4 @@ Reverse a LinkedList (easy)

Reverse a Sub-list (medium)

Reverse every K-element Sub-list (medium)
Reverse every K-element Sub-list (medium)
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
= Tree Breadth First Search,树上的BFS
[#breadth-first-search]
= Tree Breadth First Search 广度优先搜索

== Tree Breadth First Search,树上的BFS

这种模式基于宽搜(Breadth First Search (BFS)),适用于需要遍历一颗树。借助于队列数据结构,从而能保证树的节点按照他们的层数打印出来。打印完当前层所有元素,才能执行到下一层。所有这种需要遍历树且需要一层一层遍历的问题,都能用这种模式高效解决。

Expand All @@ -22,4 +25,4 @@ Minimum Depth of a Binary Tree (easy)

Level Order Successor (easy)

Connect Level Order Siblings (medium)
Connect Level Order Siblings (medium)
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
= Tree Depth First Search,树上的DFS
[#depth-first-search]
= Depth First Search 深度优先搜索

== Tree Depth First Search,树上的DFS

树形DFS基于深搜(Depth First Search (DFS))技术来实现树的遍历。

Expand All @@ -24,4 +27,4 @@ Sum of Path Numbers (medium)

Path With Given Sequence (medium)

Count Paths for a Sum (medium)
Count Paths for a Sum (medium)
3 changes: 2 additions & 1 deletion docs/0000-09-two-heaps.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#two-heaps]
= Two Heaps,双堆类型

很多问题中,我们被告知,我们拿到一大把可以分成两队的数字。为了解决这个问题,我们感兴趣的是,怎么把数字分成两半?使得:小的数字都放在一起,大的放在另外一半。双堆模式就能高效解决此类问题。
Expand All @@ -16,4 +17,4 @@ Find the Median of a Number Stream (medium)

Sliding Window Median (hard)

Maximize Capital (hard)
Maximize Capital (hard)
3 changes: 2 additions & 1 deletion docs/0000-10-subsets.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#subsets]
= Subsets,子集类型,一般都是使用多重DFS

超级多的编程面试问题都会涉及到排列和组合问题。子集问题模式讲的是用BFS来处理这些问题。
Expand Down Expand Up @@ -27,4 +28,4 @@ String Permutations by changing case (medium)

Balanced Parentheses (hard)

Unique Generalized Abbreviations (hard)
Unique Generalized Abbreviations (hard)
3 changes: 2 additions & 1 deletion docs/0000-11-modified-binary-search.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#modified-binary-search]
= Modified Binary Search,改造过的二分

当你需要解决的问题的输入是排好序的数组,链表,或是排好序的矩阵,要求咱们寻找某些特定元素。这个时候的不二选择就是二分搜索。这种模式是一种超级牛的用二分来解决问题的方式。
Expand All @@ -23,4 +24,4 @@ Search in a Sorted Infinite Array (medium)

Minimum Difference Element (medium)

Bitonic Array Maximum (easy)
Bitonic Array Maximum (easy)
1 change: 1 addition & 0 deletions docs/0000-12-top-k-elements.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#top-k-elements]
= Top ‘K’ Elements,前K个系列

任何让我们求解最大/最小/最频繁的K个元素的题,都遵循这种模式。
Expand Down
3 changes: 2 additions & 1 deletion docs/0000-13-k-way-merge.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#k-way-merge]
= K-way merge,多路归并

K路归并能帮咱们解决那些涉及到多组排好序的数组的问题。
Expand All @@ -24,4 +25,4 @@ Kth Smallest Number in M Sorted Lists (Medium)

Kth Smallest Number in a Sorted Matrix (Hard)

Smallest Number Range (Hard)
Smallest Number Range (Hard)
3 changes: 2 additions & 1 deletion docs/0000-14-topological-sort.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[#topological-sort]
= Topological Sort (Graph),拓扑排序类型

拓扑排序模式用来寻找一种线性的顺序,这些元素之间具有依懒性。比如,如果事件B依赖于事件A,那A在拓扑排序顺序中排在B的前面。
Expand Down Expand Up @@ -37,4 +38,4 @@ Tasks Scheduling Order (medium)

All Tasks Scheduling Orders (hard)

Alien Dictionary (hard)
Alien Dictionary (hard)

0 comments on commit 7161169

Please sign in to comment.