---
# System prepended metadata

title: 資料結構

---

# 資料結構

### Asymptotic Notation-Big "oh"

#### f(n) = O(g(n)) iff
$\exists$ positive const , $c$ and $n_{0}\ni$  $f(n)$ $\leq$ $cg(n)$ $n$,$n$ $\geq$ $n_{0}$

eg. 
* $3n+2 = O(n)$  &emsp;&emsp;&emsp;&emsp;&emsp;   $3n+2 \leq 4n$ for all n $\geq$ 2

* $10n^{2}+4n+2=O(n^{2})$ &emsp;  $10n^{2}+4n+2$ $\leq$ 11$n^{2}$ for all n>=10

* $3n+2=O(n^{2})$ &emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;  $3n+2 \leq n^{2}$ for all n>=4

$g(n)$ should be a least upper bound


