✏️ Explanatory Question
Determine the Big-O notation for the following expressions:
(a) 5n5/2 + 12n2/5
(b) 6·log2(n) + 9n
(c) 3n4 + n·log2(n)
(d) 5n2 + 13n3/2
Determine the Big-O notation for the following expressions:
(a) 5n5/2 + 12n2/5
(b) 6·log2(n) + 9n
(c) 3n4 + n·log2(n)
(d) 5n2 + 13n3/2
Ans.
(a) O(n5/2)
(b) O(n)
(c) O(n4)
(d) O(n2)
💡 Explanation:
To determine the Big-O notation of an expression, keep only the fastest-growing term and remove its constant coefficient. Lower-order terms become insignificant as n grows.
Memory tip: For a sum of terms, compare their growth rates, select the fastest-growing term, and then drop its coefficient.