> For the complete documentation index, see [llms.txt](https://easonwang.gitbook.io/algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easonwang.gitbook.io/algorithm/overview/readme.md).

# BigO

我們在演算法中通常會用最差的時間複雜度來表示，也就是花費最久的可能時間。即為 BigO

然後 我們可以忽略掉過小的次方，例如 4n^2 + 2n 則時間複雜度為 O(n^2)

推導如下：

```javascript
g(n)=4n+10，則g(n)可以用O(n)來表示，即f(n)=n
證明：g(n) ≦ c*f(n)
4n+10 ≦ cn  所以  (c-4)n ≧10
可以取c=5 且 n ≧ 10 且 N=10
所以只要c ≧ 5, n≧10時
4n+10 ≦ 5n
```

推薦閱讀：

<http://lms.ctl.cyut.edu.tw/sys/read_attach.php?id=929422>
