際際滷

際際滷Share a Scribd company logo
Algorithm
Big O Notation
Bill Kim(蟾) | ibillkim@gmail.com
覈谿
Asymptotic Notation
Big-立 notation
Big O Notation
Big -notation
Time Complexity
References
Asymptotic Notation
貉危 螻狩 螻襴讀 企 覓語襯 豕 觜襯願 
朱 豌襴蠍  .
蠏碁 螻襴讀  焔リ骸 煙 豸′蠍 伎 蠏 
蠍磯(Asymptotic Notation)企朱 蟆 .
蠏 蠍磯 朱 覓語 O 蠍磯, 覓語 る螳(立)
蠍磯, 覓語 誤() 蠍磯, 覓語 o 蠍磯, 覓語 る螳
() 蠍磯 れ 譬襯螳 給.
讌襷 磯Μ螳 れ襦 襷  覦 覓語 O 蠍磯
Big O 蠍磯 襷 .
Big-立 notation
觜-る螳手 曙朱 蠏殊  覩誤. (Asymptotic
lower bound)
企 螻襴讀 覓企Μ 觜朱 蠍一ヾ 觜蟲  螳蟇磯 轟
譬讌 る 詞.
Big-立 notation
 : 立(g(n)) = { f(n) | 豢覿  n 蟯伎 f(n)>= c*g(n) 
 "" c螳 譟伎 }
襯 れ 2*n^2 伎 立(n) 朱 蠍壱  給.
觜-る手 覿襯企 蠏殊  覩誤. (Asymptotic
upper bound)
讀 企 螻襴讀 覓企Μ 觜 蠍一ヾ 觜蟲  螳蟇磯 
 譬る 詞企.
Big O 蠍磯 螻襴讀  覦 螻糾 覲旧° 覿覿 螳蟯
 讌襦  蠍磯.
Big O Notation
 : O(g(n)) = { f(n) | 豢覿  n 蟯伎 f(n)<= c*g(n) 
 "" c螳 譟伎 }
f(n) = 5n^3 - n^2  觜 蠍磯朱 覃 O(n^3) .
Big O Notation
觜-誤手 覿襯企 襷襦 蠏殊 螻  蟲讌 覩誤
. (Asymptotic tighter bound)
企 螻襴讀 覓企Μ 蟇磯 譬朱 蠍一ヾ 觜蟲 
 覯  譟伎る 詞.
Big -notation
 : (g(n)) = { Big O and Big Omega}
襯 る n^2+ 3*n+ 1023 (n^2)襦 蠍磯.
Big -notation
Time Complexity
螳覲旧°(Time Complexity) 企 覓語襯 願屋 蟇碁Μ
螳螻 レ 蟯螻襯 覩誤.
螻襴讀 煙 螳 譴 螳 讌襦   給
.
蠏碁 Big O 蠍磯朱 蠍壱 蟆曙一 螳 覲旧° 譬襯襯 覯
危エ覲願給.
Time Complexity : Constant time
 螳朱 Big O 蠍磯朱 O(1)朱 蠍磯 螳.
ろ 一危磯ゼ j 觜手  蟆曙 企 螳 .
一危郁 襷  螳 螳  蟆曙磯ゼ 襷.
螳 螳覲旧°螳 譬り(觜襯企)   蟆給.
Time Complexity : Logarithmic time
襦蠏 螳朱 Big O 蠍磯朱 O(logn)朱 蠍磯 螳
.
襦蠏 豌 一危郁 讀螳 讀螳 襷讌襦 伎
 襯 襷.
覲危 伎 碁Μ  企 螳 螳給.
谿瑚襦 Big O 蠍磯 襦蠏語 覦 旧朱 2(log2)襦
螳譯狩.
Time Complexity : Linear time
 螳朱 Big O 蠍磯朱 O(n)朱 蠍磯 螳.
ル 一危一 襷 螻 螳 讀螳 蟆曙磯ゼ 襷.
覦一伎企 襷 襴ろ語  蟆曙 企 螳 .
Time Complexity : Linearithmic time
 襦蠏 螳朱 Big O 蠍磯朱 O(n logn)朱 蠍磯
螳.
 螳覲企る 所 襴り 覲企 蟆給.
一危郁 襷讌 襦 襷蟆 螻 企 覈 豬.
覲危ク朱   螻襴讀 企 螳 覲伎譯朱
, 覲,   煙 伎 螳 螳讌.
Time Complexity : Quadratic time
ろ 螳朱 Big O 蠍磯朱 O(n^2)朱 蠍磯 螳
.
ル 一危一 4覦(螻) 螳 蟇碁Μ 蟆 襷.
磯殊 蠏碁Μ  手 覲  給.
伎 襭覓, 曙 ,  , 覯觚  煙 伎 企麹.
Time Complexity : Cubic time
襷谿螳讌襦 ろ 螳朱 Big O 蠍磯朱 O(n^3)朱 蠍磯
 螳.
O(n^2) 襷谿螳讌襦 ル 一危郁 襷讌 襦 蠍壱蠍
襦 企. O(n^3) 一危  3螻(8覦) 襷 企
.
襷谿螳讌襦  手 覲  給.
殊 襭覓 煙 伎 企麹.
Time Complexity : Exponential time
讌 螳朱 Big O 蠍磯朱 O(2^n)朱 蠍磯 螳
.
豕 螳 覲旧°襯 企 れ襦 企 螳 蟇碁Μ 一危
螳 襷 蟆曙 螻襴讀  覿襯 螻ろ企骸 螳 給.
朱慨豺 伎 蟆曙 企 螳 螳讌  給.
Time Complexity : Factorial time
螻 螳朱 Big O 蠍磯朱 O(n!)朱 蠍磯 螳.
れ 殊  伎 朱 貉危磯 螻壱   螳
螳讌.
伎  煙 襴殊 蟆曙 企 螳 螳讌.
Time Complexity
References
[1] 觜  蠍磯(Big O notation) : https://
johngrib.github.io/wiki/big-O-notation/
[2] 蠏 蠍磯 : https://ko.wikipedia.org/wiki/蠏_蠍磯
[3] 觜 蠍磯 (big-O notation) 企 : https://
noahlogs.tistory.com/27
[4] [Complexity Analysis] Time Complexity and Big-O
Notation : https://velog.io/@shaqok/Complexity-
Analysis-Time-Complexity-and-Big-O-Notation
[5] big-O notation : https://velog.io/@hanrimjo/big-O-
notation
References
[6] Learning Big O Notation with Swift : https://
medium.com/swift-algorithms-data-structures/learn-big-o-
notation-with-swift-4ab83195859e
[7] Complexity and Big-O Notation In Swift : https://
medium.com/journey-of-one-thousand-apps/complexity-
and-big-o-notation-in-swift-478a67ba20e7
[8] A Beginner's Guide to Big O in Swift : https://
learnappmaking.com/big-o-notation-swift/
[9] An introduction to Big O in Swift : https://
www.donnywals.com/an-introduction-to-big-o-in-swift/
[10] Big O Notation : https://dennis-xlc.gitbooks.io/swift-
algorithms-data-structures/chapter1.html
References
[11] [Algorithm] Time Complexity : https://velog.io/
@junyong92/TIL-Time-Complexity
[12] [螻襴讀] 蠏殊 蠍磯 : https://
satisfactoryplace.tistory.com/70
Thank you!

More Related Content

Similar to [Algorithm] Big O Notation (8)

覿覲
覿覲覿覲
覿覲
麹 譟
襭蟲譟 Project2
襭蟲譟 Project2襭蟲譟 Project2
襭蟲譟 Project2
KoChungWook
Dp 1
Dp 1Dp 1
Dp 1
DavidPark267
貊ろ 蟆 蠍 C++ 03 螳 覲旧° 螳襯 讌給.
貊ろ 蟆 蠍 C++ 03 螳 覲旧°  螳襯 讌給.貊ろ 蟆 蠍 C++ 03 螳 覲旧°  螳襯 讌給.
貊ろ 蟆 蠍 C++ 03 螳 覲旧° 螳襯 讌給.
ultrasuperrok
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
ultrasuperrok
[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison
Bill Kim
螻襴讀 ろ磯() Seungdols
螻襴讀 ろ磯() Seungdols螻襴讀 ろ磯() Seungdols
螻襴讀 ろ磯() Seungdols
seungdols
覿覲
覿覲覿覲
覿覲
麹 譟
襭蟲譟 Project2
襭蟲譟 Project2襭蟲譟 Project2
襭蟲譟 Project2
KoChungWook
貊ろ 蟆 蠍 C++ 03 螳 覲旧° 螳襯 讌給.
貊ろ 蟆 蠍 C++ 03 螳 覲旧°  螳襯 讌給.貊ろ 蟆 蠍 C++ 03 螳 覲旧°  螳襯 讌給.
貊ろ 蟆 蠍 C++ 03 螳 覲旧° 螳襯 讌給.
ultrasuperrok
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
貊ろ 蟆 蠍 C++ 03(螳 覲旧°)襯 る ppt
ultrasuperrok
[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison[Algorithm] Sorting Comparison
[Algorithm] Sorting Comparison
Bill Kim
螻襴讀 ろ磯() Seungdols
螻襴讀 ろ磯() Seungdols螻襴讀 ろ磯() Seungdols
螻襴讀 ろ磯() Seungdols
seungdols

More from Bill Kim (20)

[Algorithm] Shell Sort
[Algorithm] Shell Sort[Algorithm] Shell Sort
[Algorithm] Shell Sort
Bill Kim
[Algorithm] Radix Sort
[Algorithm] Radix Sort[Algorithm] Radix Sort
[Algorithm] Radix Sort
Bill Kim
[Algorithm] Quick Sort
[Algorithm] Quick Sort[Algorithm] Quick Sort
[Algorithm] Quick Sort
Bill Kim
[Algorithm] Heap Sort
[Algorithm] Heap Sort[Algorithm] Heap Sort
[Algorithm] Heap Sort
Bill Kim
[Algorithm] Counting Sort
[Algorithm] Counting Sort[Algorithm] Counting Sort
[Algorithm] Counting Sort
Bill Kim
[Algorithm] Selection Sort
[Algorithm] Selection Sort[Algorithm] Selection Sort
[Algorithm] Selection Sort
Bill Kim
[Algorithm] Merge Sort
[Algorithm] Merge Sort[Algorithm] Merge Sort
[Algorithm] Merge Sort
Bill Kim
[Algorithm] Insertion Sort
[Algorithm] Insertion Sort[Algorithm] Insertion Sort
[Algorithm] Insertion Sort
Bill Kim
[Algorithm] Bubble Sort
[Algorithm] Bubble Sort[Algorithm] Bubble Sort
[Algorithm] Bubble Sort
Bill Kim
[Algorithm] Binary Search
[Algorithm] Binary Search[Algorithm] Binary Search
[Algorithm] Binary Search
Bill Kim
[Algorithm] Recursive(蠏)
[Algorithm] Recursive(蠏)[Algorithm] Recursive(蠏)
[Algorithm] Recursive(蠏)
Bill Kim
[Swift] Data Structure - AVL
[Swift] Data Structure - AVL[Swift] Data Structure - AVL
[Swift] Data Structure - AVL
Bill Kim
[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree
Bill Kim
[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)
Bill Kim
[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)
Bill Kim
[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree
Bill Kim
[Swift] Data Structure - Tree
[Swift] Data Structure - Tree[Swift] Data Structure - Tree
[Swift] Data Structure - Tree
Bill Kim
[Swift] Data Structure - Graph
[Swift] Data Structure - Graph[Swift] Data Structure - Graph
[Swift] Data Structure - Graph
Bill Kim
[Swift] Data Structure - Heap
[Swift] Data Structure - Heap[Swift] Data Structure - Heap
[Swift] Data Structure - Heap
Bill Kim
[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue
Bill Kim
[Algorithm] Shell Sort
[Algorithm] Shell Sort[Algorithm] Shell Sort
[Algorithm] Shell Sort
Bill Kim
[Algorithm] Radix Sort
[Algorithm] Radix Sort[Algorithm] Radix Sort
[Algorithm] Radix Sort
Bill Kim
[Algorithm] Quick Sort
[Algorithm] Quick Sort[Algorithm] Quick Sort
[Algorithm] Quick Sort
Bill Kim
[Algorithm] Heap Sort
[Algorithm] Heap Sort[Algorithm] Heap Sort
[Algorithm] Heap Sort
Bill Kim
[Algorithm] Counting Sort
[Algorithm] Counting Sort[Algorithm] Counting Sort
[Algorithm] Counting Sort
Bill Kim
[Algorithm] Selection Sort
[Algorithm] Selection Sort[Algorithm] Selection Sort
[Algorithm] Selection Sort
Bill Kim
[Algorithm] Merge Sort
[Algorithm] Merge Sort[Algorithm] Merge Sort
[Algorithm] Merge Sort
Bill Kim
[Algorithm] Insertion Sort
[Algorithm] Insertion Sort[Algorithm] Insertion Sort
[Algorithm] Insertion Sort
Bill Kim
[Algorithm] Bubble Sort
[Algorithm] Bubble Sort[Algorithm] Bubble Sort
[Algorithm] Bubble Sort
Bill Kim
[Algorithm] Binary Search
[Algorithm] Binary Search[Algorithm] Binary Search
[Algorithm] Binary Search
Bill Kim
[Algorithm] Recursive(蠏)
[Algorithm] Recursive(蠏)[Algorithm] Recursive(蠏)
[Algorithm] Recursive(蠏)
Bill Kim
[Swift] Data Structure - AVL
[Swift] Data Structure - AVL[Swift] Data Structure - AVL
[Swift] Data Structure - AVL
Bill Kim
[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree[Swift] Data Structure - Binary Search Tree
[Swift] Data Structure - Binary Search Tree
Bill Kim
[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)[Swift] Data Structure - Graph(BFS)
[Swift] Data Structure - Graph(BFS)
Bill Kim
[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)[Swift] Data Structure - Graph(DFS)
[Swift] Data Structure - Graph(DFS)
Bill Kim
[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree[Swift] Data Structure - Binary Tree
[Swift] Data Structure - Binary Tree
Bill Kim
[Swift] Data Structure - Tree
[Swift] Data Structure - Tree[Swift] Data Structure - Tree
[Swift] Data Structure - Tree
Bill Kim
[Swift] Data Structure - Graph
[Swift] Data Structure - Graph[Swift] Data Structure - Graph
[Swift] Data Structure - Graph
Bill Kim
[Swift] Data Structure - Heap
[Swift] Data Structure - Heap[Swift] Data Structure - Heap
[Swift] Data Structure - Heap
Bill Kim
[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue[Swift] Data Structure - Dequeue
[Swift] Data Structure - Dequeue
Bill Kim

[Algorithm] Big O Notation

  • 1. Algorithm Big O Notation Bill Kim(蟾) | ibillkim@gmail.com
  • 2. 覈谿 Asymptotic Notation Big-立 notation Big O Notation Big -notation Time Complexity References
  • 3. Asymptotic Notation 貉危 螻狩 螻襴讀 企 覓語襯 豕 觜襯願 朱 豌襴蠍 . 蠏碁 螻襴讀 焔リ骸 煙 豸′蠍 伎 蠏 蠍磯(Asymptotic Notation)企朱 蟆 . 蠏 蠍磯 朱 覓語 O 蠍磯, 覓語 る螳(立) 蠍磯, 覓語 誤() 蠍磯, 覓語 o 蠍磯, 覓語 る螳 () 蠍磯 れ 譬襯螳 給. 讌襷 磯Μ螳 れ襦 襷 覦 覓語 O 蠍磯 Big O 蠍磯 襷 .
  • 4. Big-立 notation 觜-る螳手 曙朱 蠏殊 覩誤. (Asymptotic lower bound) 企 螻襴讀 覓企Μ 觜朱 蠍一ヾ 觜蟲 螳蟇磯 轟 譬讌 る 詞.
  • 5. Big-立 notation : 立(g(n)) = { f(n) | 豢覿 n 蟯伎 f(n)>= c*g(n) "" c螳 譟伎 } 襯 れ 2*n^2 伎 立(n) 朱 蠍壱 給.
  • 6. 觜-る手 覿襯企 蠏殊 覩誤. (Asymptotic upper bound) 讀 企 螻襴讀 覓企Μ 觜 蠍一ヾ 觜蟲 螳蟇磯 譬る 詞企. Big O 蠍磯 螻襴讀 覦 螻糾 覲旧° 覿覿 螳蟯 讌襦 蠍磯. Big O Notation
  • 7. : O(g(n)) = { f(n) | 豢覿 n 蟯伎 f(n)<= c*g(n) "" c螳 譟伎 } f(n) = 5n^3 - n^2 觜 蠍磯朱 覃 O(n^3) . Big O Notation
  • 8. 觜-誤手 覿襯企 襷襦 蠏殊 螻 蟲讌 覩誤 . (Asymptotic tighter bound) 企 螻襴讀 覓企Μ 蟇磯 譬朱 蠍一ヾ 觜蟲 覯 譟伎る 詞. Big -notation
  • 9. : (g(n)) = { Big O and Big Omega} 襯 る n^2+ 3*n+ 1023 (n^2)襦 蠍磯. Big -notation
  • 10. Time Complexity 螳覲旧°(Time Complexity) 企 覓語襯 願屋 蟇碁Μ 螳螻 レ 蟯螻襯 覩誤. 螻襴讀 煙 螳 譴 螳 讌襦 給 . 蠏碁 Big O 蠍磯朱 蠍壱 蟆曙一 螳 覲旧° 譬襯襯 覯 危エ覲願給.
  • 11. Time Complexity : Constant time 螳朱 Big O 蠍磯朱 O(1)朱 蠍磯 螳. ろ 一危磯ゼ j 觜手 蟆曙 企 螳 . 一危郁 襷 螳 螳 蟆曙磯ゼ 襷. 螳 螳覲旧°螳 譬り(觜襯企) 蟆給.
  • 12. Time Complexity : Logarithmic time 襦蠏 螳朱 Big O 蠍磯朱 O(logn)朱 蠍磯 螳 . 襦蠏 豌 一危郁 讀螳 讀螳 襷讌襦 伎 襯 襷. 覲危 伎 碁Μ 企 螳 螳給. 谿瑚襦 Big O 蠍磯 襦蠏語 覦 旧朱 2(log2)襦 螳譯狩.
  • 13. Time Complexity : Linear time 螳朱 Big O 蠍磯朱 O(n)朱 蠍磯 螳. ル 一危一 襷 螻 螳 讀螳 蟆曙磯ゼ 襷. 覦一伎企 襷 襴ろ語 蟆曙 企 螳 .
  • 14. Time Complexity : Linearithmic time 襦蠏 螳朱 Big O 蠍磯朱 O(n logn)朱 蠍磯 螳. 螳覲企る 所 襴り 覲企 蟆給. 一危郁 襷讌 襦 襷蟆 螻 企 覈 豬. 覲危ク朱 螻襴讀 企 螳 覲伎譯朱 , 覲, 煙 伎 螳 螳讌.
  • 15. Time Complexity : Quadratic time ろ 螳朱 Big O 蠍磯朱 O(n^2)朱 蠍磯 螳 . ル 一危一 4覦(螻) 螳 蟇碁Μ 蟆 襷. 磯殊 蠏碁Μ 手 覲 給. 伎 襭覓, 曙 , , 覯觚 煙 伎 企麹.
  • 16. Time Complexity : Cubic time 襷谿螳讌襦 ろ 螳朱 Big O 蠍磯朱 O(n^3)朱 蠍磯 螳. O(n^2) 襷谿螳讌襦 ル 一危郁 襷讌 襦 蠍壱蠍 襦 企. O(n^3) 一危 3螻(8覦) 襷 企 . 襷谿螳讌襦 手 覲 給. 殊 襭覓 煙 伎 企麹.
  • 17. Time Complexity : Exponential time 讌 螳朱 Big O 蠍磯朱 O(2^n)朱 蠍磯 螳 . 豕 螳 覲旧°襯 企 れ襦 企 螳 蟇碁Μ 一危 螳 襷 蟆曙 螻襴讀 覿襯 螻ろ企骸 螳 給. 朱慨豺 伎 蟆曙 企 螳 螳讌 給.
  • 18. Time Complexity : Factorial time 螻 螳朱 Big O 蠍磯朱 O(n!)朱 蠍磯 螳. れ 殊 伎 朱 貉危磯 螻壱 螳 螳讌. 伎 煙 襴殊 蟆曙 企 螳 螳讌.
  • 20. References [1] 觜 蠍磯(Big O notation) : https:// johngrib.github.io/wiki/big-O-notation/ [2] 蠏 蠍磯 : https://ko.wikipedia.org/wiki/蠏_蠍磯 [3] 觜 蠍磯 (big-O notation) 企 : https:// noahlogs.tistory.com/27 [4] [Complexity Analysis] Time Complexity and Big-O Notation : https://velog.io/@shaqok/Complexity- Analysis-Time-Complexity-and-Big-O-Notation [5] big-O notation : https://velog.io/@hanrimjo/big-O- notation
  • 21. References [6] Learning Big O Notation with Swift : https:// medium.com/swift-algorithms-data-structures/learn-big-o- notation-with-swift-4ab83195859e [7] Complexity and Big-O Notation In Swift : https:// medium.com/journey-of-one-thousand-apps/complexity- and-big-o-notation-in-swift-478a67ba20e7 [8] A Beginner's Guide to Big O in Swift : https:// learnappmaking.com/big-o-notation-swift/ [9] An introduction to Big O in Swift : https:// www.donnywals.com/an-introduction-to-big-o-in-swift/ [10] Big O Notation : https://dennis-xlc.gitbooks.io/swift- algorithms-data-structures/chapter1.html
  • 22. References [11] [Algorithm] Time Complexity : https://velog.io/ @junyong92/TIL-Time-Complexity [12] [螻襴讀] 蠏殊 蠍磯 : https:// satisfactoryplace.tistory.com/70