S SmartDocs

Algoritmos e estruturas de dados

Ordenação, árvores, hashing, algoritmos de grafos, KMP, prática de LeetCode e análise de algoritmos.

Algorithms Atualizado 2026-04-26

KMP 與 LPS 演算法 — 完整教學(含多範例逐步推導)

本教材把 LPS(Longest Proper Prefix–Suffix) 與 KMP(Knuth–Morris–Pratt) 當成兩個獨立但相依的主題。 LPS 不只是 KMP 的副產物,它本身就是一個強大的字串工具;KMP 則是 LPS 最有名的應用之一。

Ler artigo →
Algorithms Atualizado 2026-02-03

Data Structures Implementations in C++

This repository contains educational C++ implementations of various data structures for teaching purposes.

Ler artigo →
Algorithms Atualizado 2026-03-28

遞迴 Recursion — 完整教學

1. 什麼是遞迴?1什麼是遞迴 2. 遞迴的三大要素2遞迴的三大要素 3. 遞迴的執行原理:Call Stack3遞迴的執行原理callstack 4. 經典遞迴範例4經典遞迴範例 5. 遞迴的優點5遞迴的優點 6. 遞迴的缺點6遞迴的缺點 7. 遞迴 vs 迭代 比較表7遞迴vs迭代比較表 8. 如何將遞迴改成非遞迴(迭代)8如何將遞迴改成非遞迴迭代 9. 轉換技巧總結9轉換技巧總結 10. 進階:尾遞迴優化10進階尾遞迴優化 11.

Ler artigo →
Algorithms Atualizado 2026-07-03

排序演算法全集(C++17)

每個檔案都是獨立、可編譯執行的示範程式,內含:原理註解、複雜度分析、 穩定性說明、多組測試(含空陣列、單元素、已排序、反向、重複元素等邊界情況)。

Ler artigo →
Algorithms Atualizado 2026-04-12

排序演算法 — 教材(含 C++ 範例)

1. 總覽與比較1總覽與比較 2. 氣泡排序(Bubble Sort)2氣泡排序bubblesort 3. 選擇排序(Selection Sort)3選擇排序selectionsort 4. 插入排序(Insertion Sort)4插入排序insertionsort 5. 希爾排序(Shell Sort)5希爾排序shellsort 6. 合併排序(Merge Sort)6合併排序mergesort 7. 快速排序(Quick Sor

Ler artigo →
Algorithms Atualizado 2026-04-26

Splay Tree(伸展樹)演算法完整教學

1. Splay Tree 簡介與動機1splaytree簡介與動機 2. 基本性質與設計理念2基本性質與設計理念 3. 基本旋轉(Left / Right Rotation)3基本旋轉leftrightrotation 4. Splaying 操作 — 三種情況4splaying操作三種情況 4.1 Zig(單旋)41zig單旋 4.2 ZigZig(同向雙旋)42zigzig同向雙旋 4.3 ZigZag(異向雙旋)43zigzag

Ler artigo →
Algorithms Atualizado 2026-04-26

第三方支付平台前後端完整教學 — 類 Stripe / PayPal 架構、API 對接與 Webhook

本教材介紹第三方支付平台的全端架構與 API 對接方式,並以類似 Stripe.com、PayPal 的產品型態作為參考。 內容涵蓋商戶前端、商戶後端、支付平台、收單銀行、卡組織、Webhook、退款、對帳、安全與錯誤處理。 注意:Stripe、PayPal 的實際 API 會隨版本與地區改變。本文使用教學用 API 形狀說明設計思想,實作時應以官方文件與合約為準。

Ler artigo →
Algorithms Atualizado 2026-03-28

Tree、Binary Tree、Balanced Binary Tree — 完整教學

1. Tree(樹)基本概念1tree樹基本概念 2. Tree 的表示法2tree的表示法 3. Tree 的遍歷(Traversal)3tree的遍歷traversal 4. Binary Tree(二元樹)4binarytree二元樹 5. Binary Tree 的性質與定理5binarytree的性質與定理 6. Binary Tree 的遍歷6binarytree的遍歷 7. Binary Search Tree(二元搜尋樹

Ler artigo →
Automata Atualizado 2026-07-15

練習題完全詳解[0.3em] 不可判定性 · NP 完備 · DPLL · 2SAT · 機率圖靈機 · 單純形法 · TSP[0.5em] 5CCS2FC2 Foundations of Computing II --- 測驗題逐題解析

[1]colback=qblue!6,colframe=qblue,fonttitle=, title=#1,breakable,left=2mm,right=2mm [1]colback=sgreen!6,colframe=sgreen,fonttitle=, title=#1,breakable,left=2mm,right=2mm [1]colback=norange!7,colframe=norange,fonttitle=,

Ler artigo →
Automata Atualizado 2026-07-23

King's College London[4pt] 5CCS2FC2 Foundations of Computing II[4pt] 2019 年 1 月考卷 --- 逐題詳解

colback=green!6, colframe=green!45!black, title=, fonttitle=, boxrule=0.8pt, arc=2mm, left=2mm, right=2mm, top=1mm, bottom=1mm colback=blue!4, colframe=blue!55!black, boxrule=0.6pt, arc=2mm, left=2mm, right=2mm, top=1.5m

Ler artigo →
Automata Atualizado 2026-07-23

King's College London[4pt] 5CCS2FC2 Foundations of Computing II[4pt] 2020 年 1 月考卷 --- 逐題詳解

colback=green!6, colframe=green!45!black, title=, fonttitle=, boxrule=0.8pt, arc=2mm, left=2mm, right=2mm, top=1mm, bottom=1mm colback=blue!4, colframe=blue!55!black, boxrule=0.6pt, arc=2mm, left=2mm, right=2mm, top=1.5m

Ler artigo →
Automata Atualizado 2026-06-10

計算理論基礎:有限自動機、正則語言與圖靈機[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第一週內容編寫)

, >=Stealth[round], shorten >=1pt, auto, node distance=2.2cm, initial text=

Ler artigo →
Automata Atualizado 2026-07-15

計算的極限[0.3em] 不可判定性與 Entscheidungsproblem 學習教材[0.5em] 5CCS2FC2 Foundations of Computing II --- Week 10 白話講義

[1]colback=thmblue!6,colframe=thmblue,fonttitle=, title=#1,breakable,left=2mm,right=2mm [1]colback=exgreen!6,colframe=exgreen,fonttitle=, title=#1,breakable,left=2mm,right=2mm [1]colback=noteorange!7,colframe=noteorange,

Ler artigo →
Automata Atualizado 2026-07-08

計算的極限:不可判定性[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第十週內容編寫)[2pt] 通用圖靈機、對角線論證、停機問題與 Entscheidungsproblem

, shorten >=1pt, , flowdec/.style=draw, diamond, aspect=2.2, fill=orange!12, align=center, font=, inner sep=1pt, flowacc/.style=draw, rounded corners, fill=green!14, align=center, font=, inner sep=5pt, thick, flowrej/.st

Ler artigo →
Automata Atualizado 2026-07-08

計算極限之外:可計算枚舉性與映射歸約[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第十一週內容編寫)[2pt] 半可判定性、交錯模擬、co-C.E. 與映射歸約

, shorten >=1pt, , flowdec/.style=draw, diamond, aspect=2.2, fill=orange!12, align=center, font=, inner sep=1pt, flowacc/.style=draw, rounded corners, fill=green!14, align=center, font=, inner sep=5pt, thick, flowrej/.st

Ler artigo →
Automata Atualizado 2026-06-18

複雜度類 NP 專題[4pt] 從「驗證 vs. 求解」談起,並詳述百萬美元問題 P vs NP

RGB120,20,40 RGB246,243,238 RGB160,140,110 , thmbox/.style=colback=blue!4, colframe=blue!45!black, fonttitle=, boxrule=0.6pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt, egbox/.style=colback=green!5, colframe=gree

Ler artigo →
Automata Atualizado 2026-06-10

P 與 NP:百萬美元問題[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第二週內容編寫)

, >=Stealth[round], shorten >=1pt, auto, node distance=2.2cm, initial text=

Ler artigo →
Automata Atualizado 2026-06-22

遞迴、分治法與主定理[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第三週內容編寫)[2pt] 附:Cook--Levin 定理(

RGB120,20,40 RGB246,243,238 RGB160,140,110 , thmbox/.style=colback=blue!4, colframe=blue!45!black, fonttitle=, boxrule=0.6pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt, egbox/.style=colback=green!5, colframe=gree

Ler artigo →
Automata Atualizado 2026-06-29

圖論演算法導論[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第四週內容編寫)[2pt] BFS / DFS、最小生成樹、拓撲排序與強連通元件

, shorten >=1pt, node distance=2.2cm, , vtxvis/.style=circle, draw, thick, fill=blue!18, minimum size=7mm, inner sep=1pt, font=, vtxtree/.style=circle, draw, thick, fill=green!18, minimum size=7mm, inner sep=1pt, font=,

Ler artigo →
Automata Atualizado 2026-07-02

SAT 求解導論[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第五週內容編寫)[2pt] 受限 SAT、2-SAT 與蘊涵圖、DPLL 與貪婪局部搜尋

, shorten >=1pt, node distance=2.2cm, , litpos/.style=circle, draw, thick, fill=blue!15, minimum size=8mm, inner sep=1pt, font=, litneg/.style=circle, draw, thick, fill=red!12, minimum size=8mm, inner sep=1pt, font=,

Ler artigo →
Automata Atualizado 2026-07-02

近似演算法與旅行推銷員問題[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第七週內容編寫)[2pt] 最佳化問題、近似比、2OPT 演算法與不可近似性

RGB120,20,40 RGB246,243,238 RGB160,140,110 , thmbox/.style=colback=blue!4, colframe=blue!45!black, fonttitle=, boxrule=0.6pt, arc=2pt, left=6pt, right=6pt, top=4pt, bottom=4pt, egbox/.style=colback=green!5, colframe=gree

Ler artigo →
Automata Atualizado 2026-07-08

線性規劃與整數規劃[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第八週內容編寫)[2pt] 線性規劃、單純形法、整數規劃與分枝定界

, shorten >=1pt, , bbnode/.style=draw, rounded corners, fill=blue!6, align=center, font=, inner sep=4pt, bbbest/.style=draw, rounded corners, fill=green!12, align=center, font=, inner sep=4pt, thick, bbdead/.style=draw,

Ler artigo →
Automata Atualizado 2026-07-08

機率圖靈機與隨機複雜度類[4pt] 完整教材(依據 5CCS2FC2 Foundations of Computing II 第九週內容編寫)[2pt] 機率與期望值、機率圖靈機、BPP 與 ZPP

, shorten >=1pt, , cfgacc/.style=draw, rounded corners, fill=green!14, font=, inner sep=3pt, thick, align=center, cfgrej/.style=draw, rounded corners, fill=red!10, font=, inner sep=3pt, thick, align=center, flow/.style=d

Ler artigo →
leetcode Atualizado 2026-02-03

LeetCode Problem Downloader

This Python script downloads all problems from LeetCode and generates: An Excel file leetcodeproblems.xlsx containing problem metadata ID, title, difficulty, category, etc. Individual PDF files for each problem with deta

Ler artigo →