Bug fixes and improvements (#1318)

* Sync zh and zh-hant versions

* Update en/README.md

* Add a Q&A for chapter of introduction

* Update the callout headers

* Sync zh ang zh-hant versions

* Bug fixes
This commit is contained in:
Yudong Jin
2024-04-30 15:52:05 +08:00
committed by GitHub
parent 84b1ce2497
commit 870e3e5cb2
107 changed files with 779 additions and 87 deletions
@@ -59,7 +59,7 @@
![重複排列](permutations_problem.assets/permutations_ii.png)
那麼如何去除重複的排列呢?最直接地,考慮藉助一個雜湊,直接對排列結果進行去重。然而這樣做不夠優雅,**因為生成重複排列的搜尋分支沒有必要,應當提前識別並剪枝**,這樣可以進一步提升演算法效率。
那麼如何去除重複的排列呢?最直接地,考慮藉助一個雜湊集合,直接對排列結果進行去重。然而這樣做不夠優雅,**因為生成重複排列的搜尋分支沒有必要,應當提前識別並剪枝**,這樣可以進一步提升演算法效率。
### 相等元素剪枝
@@ -73,7 +73,7 @@
### 程式碼實現
在上一題的程式碼的基礎上,我們考慮在每一輪選擇中開啟一個雜湊 `duplicated` ,用於記錄該輪中已經嘗試過的元素,並將重複元素剪枝:
在上一題的程式碼的基礎上,我們考慮在每一輪選擇中開啟一個雜湊集合 `duplicated` ,用於記錄該輪中已經嘗試過的元素,並將重複元素剪枝:
```src
[file]{permutations_ii}-[class]{}-[func]{permutations_ii}