Top "Big-o" questions

The Big-O notation is used to represent asymptotic upper bounds.

What is the difference between O, Ω, and Θ?

I am learning algorithm analysis. I am having trouble understanding the difference between O, Ω, and Θ. The way they're defined is …

algorithm big-o time-complexity
What is the running time and space complexity of a huffman decode algorithm?

Say we started with a text file like: a 00 b 01 c 10 d 11 00000001011011 The algorithm would be the typical one where …

algorithm big-o huffman-code big-theta
Is list::size() really O(n)?

Recently, I noticed some people mentioning that std::list::size() has a linear complexity. According to some sources, this is …

c++ list stl complexity-theory big-o
Solving a recurrence T(n) = 2T(n/2) + n^4

I am studying using the MIT Courseware and the CLRS book Introduction to Algorithms. I am currently trying to solve …

algorithm math big-o recurrence big-theta
Tail Recursion Fibonacci

How do I implement a recursive Fibonacci function with no loops running in O(n)?

python big-o fibonacci
Solving recurrence T(n) = 2T(n/2) + Θ(1) by substitution

So I am pretty sure it is O(n) (but it might not be?), but how do you solve it …

math big-o recurrence
Space complexity of recursive function

Given the function below: int f(int n) { if (n <= 1) { return 1; } return f(n - 1) + f(n - 1); } I …

big-o space-complexity
What's time complexity of this algorithm for finding all combinations?

Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If …

c++ algorithm recursion big-o combinations
Are there any real O(n^n) algorithms?

Is there any real Algorithm with a time complexity O(n^n), that isn't just a gimmick? I can create …

algorithm complexity-theory big-o
Master's theorem with f(n)=log n

For master's theorem T(n) = a*T(n/b) + f(n) I am using 3 cases: If a*f(n/b) = …

algorithm big-o divide-and-conquer master-theorem