diff --git a/docs/chapter_sorting/quick_sort.md b/docs/chapter_sorting/quick_sort.md
index 5c57aac63..766d4d540 100755
--- a/docs/chapter_sorting/quick_sort.md
+++ b/docs/chapter_sorting/quick_sort.md
@@ -612,7 +612,7 @@ comments: true
## 11.5.4 基准数优化
-**快速排序在某些输入下的时间效率可能降低**。举一个极端例子,假设输入数组是完全倒序的,由于我们选择最左端元素作为基准数,那么在哨兵划分完成后,基准数被交换至数组最右端,导致左子数组长度为 $n - 1$、右子数组长度为 $0$ 。如此递归下去,每轮哨兵划分后的右子数组长度都为 $0$ ,分治策略失效,快速排序退化为“冒泡排序”。
+**快速排序在某些输入下的时间效率可能降低**。举一个极端例子,假设输入数组是完全倒序的,由于我们选择最左端元素作为基准数,那么在哨兵划分完成后,基准数被交换至数组最右端,导致左子数组长度为 $n - 1$、右子数组长度为 $0$ 。如此递归下去,每轮哨兵划分后都有一个子数组的长度为 $0$ ,分治策略失效,快速排序退化为“冒泡排序”的近似形式。
为了尽量避免这种情况发生,**我们可以优化哨兵划分中的基准数的选取策略**。例如,我们可以随机选取一个元素作为基准数。然而,如果运气不佳,每次都选到不理想的基准数,效率仍然不尽如人意。
diff --git a/docs/index.md b/docs/index.md
index 828911c49..1e99458c2 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -14,41 +14,109 @@ hide:
+
+
初识算法
+ + +复杂度
+ + +数组与链表
+ + +栈与队列
+ + +哈希表
+ + +树
+ + +堆
+ + +图
+ + +搜索
+ + +排序
+ + +分治
+ + +回溯
+ + +动态规划
+ + +贪心
+ +初识算法
- - -复杂度
- - -数组与链表
- - -栈与队列
- - -哈希表
- - -树
- - -堆
- - -图
- - -搜索
- - -排序
- - -分治
- - -回溯
- - -动态规划
- - -贪心
- -提供网页版和 PDF 版,兼容 PC、平板和手机,随时随地阅读
+ diff --git a/overrides/stylesheets/extra.css b/overrides/stylesheets/extra.css index 92af94360..684c06bc9 100644 --- a/overrides/stylesheets/extra.css +++ b/overrides/stylesheets/extra.css @@ -112,6 +112,11 @@ text-transform: none; } +.md-typeset a:hover { + color: var(--md-typeset-a-color); + text-decoration: underline; +} + .md-typeset code { border-radius: 0.2rem; } @@ -150,34 +155,6 @@ body { width: 100%; /* Default to full width */ } -/* rounded button */ -.rounded-button { - display: inline-flex; /* Use flexbox for alignment */ - align-items: center; /* Align items vertically */ - justify-content: center; /* Center items horizontally */ - border-radius: 100px; /* Circular corners */ - padding: 9px 18px; /* Padding around the text */ - margin: 0.15em 0; - border: none; /* Removes default border */ - background-color: var(--md-typeset-btn-color); /* Background color */ - color: var(--md-primary-fg-color) !important; /* Text color */ - font-size: 0.85em; /* Font size */ - text-align: center; /* Center the text */ - text-decoration: none; /* Remove underline from anchor text */ - cursor: pointer; /* Pointer cursor on hover */ -} - -.rounded-button:hover { - background-color: var(--md-typeset-btn-hover-color); -} - -.rounded-button svg { - fill: var(--md-primary-fg-color); /* Fill SVG icon with text color */ - width: 1.2em; - height: auto; - margin-right: 0.5em; /* Add some space between the SVG icon and the text */ -} - /* Admonition for python tutor */ .md-typeset .admonition.pythontutor, .md-typeset details.pythontutor { @@ -237,10 +214,69 @@ body { max-width: 70vw; } -.hero-btn { +/* rounded button */ +.rounded-button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 10em; margin: 0 0.1em; padding: 0.5em 1.3em; - font-size: 0.85em; + border: none; + background-color: var(--md-typeset-btn-color); + color: var(--md-primary-fg-color) !important; + text-align: center; + text-decoration: none; + cursor: pointer; +} + +.rounded-button:hover { + background-color: var(--md-typeset-btn-hover-color); +} + +.rounded-button p { + margin: 0; + margin-bottom: 0.1em; +} + +.rounded-button svg { + fill: var(--md-primary-fg-color); + width: auto; + height: 1.2em; + margin-right: 0.5em; +} + +/* text button */ +.text-button-container { + width: 100%; + display: flex; + flex-direction: row; + justify-content: center; + height: auto; + margin: 0 auto; +} + +.text-button { + display: flex; + flex-direction: row; + align-items: center; + color: var(--md-typeset-btn-color); + text-decoration: none; + margin: 0 1em; +} + +.text-button:hover { + text-decoration: underline; +} + +.text-button svg { + display: inline-block; + fill: var(--md-typeset-btn-color); + width: auto; + height: 0.9em; + background-size: cover; + padding-top: 0.17em; + margin-left: 0.4em; } /* hero image */ @@ -284,8 +320,8 @@ a:hover .hero-on-hover { } a:hover .hero-caption { + text-decoration: underline; color: var(--md-typeset-btn-color); - font-weight: bold; } /* code badge */