Escolar Documentos
Profissional Documentos
Cultura Documentos
Big-O
• Can be used to describe an algorithm's efficiency.
Our focus is on time, but Big-O is used to describe storage efficiency, as well.
• Formally: "f(x) is O(g(x))" means that there exist positive x0 and positive k such that f ( x) ≤ kg ( x) for all
x ≥ x0 .
→ Here, my k is 3 and my x0 is 2.
∗ Instead of " x 2 + 3 x + 2 ," our f (x) will be something like "selection sort".
→ example: selection sort, where n is the size of the array being sorted
• More than one variable may be used.
example: The Needleman-Wunsch algorithm for aligning two character sequences of lengths m and n is
O(mn) .