Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explains asymptotic notation, complexity classes, NP-completeness, and amortized analysis for reporting algorithm efficiency.
52% 65%+13 ptsof test cases passed
Passed 15 of 23 test cases with the skill, and 12 of 23 without it.
3 of 3 safety checks passed
Not used yet
A skill for analyzing algorithm complexity and computational efficiency in research contexts. Covers asymptotic notation, common complexity classes, NP-completeness, amortized analysis, and strategies for presenting algorithmic contributions in papers.
O(f(n)) -- Upper bound (worst case, "at most")
T(n) is O(f(n)) if T(n) <= c * f(n) for large n
Omega(f(n)) -- Lower bound (best case, "at least")
T(n) is Omega(f(n)) if T(n) >= c * f(n) for large n
Theta(f(n)) -- Tight bound (exact asymptotic growth)
Both O(f(n)) and Omega(f(n))
Common growth rates (slowest to fastest):
O(1) < O(log n) < O(sqrt(n)) < O(n) < O(n log n) < O(n^2) < O(n^3) < O(2^n) < O(n!)
def estimate_runtime(n: int, complexity: str) -> dict:
"""
Estimate practical runtime for common complexities.
Args:
n: Input size
complexity: Complexity class string
"""
import math
complexities = {
"O(1)": 1,
"O(log n)": math.log2(max(n, 1)),
"O(n)": n,
"O(n log n)": n * math.log2(max(n, 1)),
Next to this one in the catalogue, plus more from the same author.