演算法
===
###### tags: `大學必修-筆記`
CH1 Union-Find 演算法
===
## 演算法的方法
* Find -> 看 p 這個點在哪裡
* Connected -> 看 p q 兩點是否相連
* Union -> 把 p q 兩點連在一起
## quick-find
> id[] 裡面存的是,如果數字一樣 -> 同 union
* Find -> 看 p 的 id 是多少
* Connected -> 看 p q 兩點的 id 是否一樣
* Union -> 把 id[p] 的值放到 id[q] 裡
```java=
public class QuickFindUF {
private int[] id;
public QuickFindUF(int N) { // 初使化矩陣
id = new int[N];
for (int i = 0; i < N; i++)
id[i] = i;
}
public int find(
mushding changed 6 years agoView mode Like Bookmark
正規語言
===
###### tags: `大學必修-筆記`
Ch0
===
## 電腦的基本能力及限制
* Automata Theory (自動機理論)
* deals with definitions and properties of mathematical models of computation.
> 處理數學計算模型的定義和屬性
* Computability Theory (可計算性理論)
* classifies problems by those that are solvable and those that are not.
> 對可解決的問題和不可解決的問題進行分類。
* Complexity Theory (複雜度理論)
* classifies problems as easy ones and hard ones
> 將問題分類為簡單與困難。
## 三個 computational models
* Finite automaton -> 辨認 regular language
> 有
mushding changed 6 years agoBook mode Like Bookmark