Top "Complexity-theory" questions

Computational complexity theory is a branch of the theory of computation in theoretical computer science and mathematics that focuses on classifying computational problems according to their inherent difficulty.

Real-world example of exponential time complexity

I'm looking for an intuitive, real-world example of a problem that takes (worst case) exponential time complexity to solve for …

complexity-theory exponential
Complexity of the recursion: T(n) = T(n-1) + T(n-2) + C

I want to understand how to arrive at the complexity of the below recurrence relation. T(n) = T(n-1) + T(…

algorithm complexity-theory time-complexity recurrence asymptotic-complexity
What is the lookup time complexity of HashSet<T>(IEqualityComparer<T>)?

In C#.NET, I like using HashSets because of their supposed O(1) time complexity for lookups. If I have a …

c# runtime complexity-theory hashset
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
Computational complexity of TreeSet operations in Java?

I am trying to clear up some things regarding complexity in some of the operations of TreeSet. On the javadoc …

java complexity-theory red-black-tree treeset
Find buy/sell prices in array of stock values to maximize positive difference

Got this question in an interview today, and its optimized solution stopped me cold (which blows, because I really wanted …

arrays optimization complexity-theory stocks
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
NP-hard problems that are not NP-complete are harder?

From my understanding, all NP-complete problems are NP-hard but some NP-hard problems are known not to be NP-complete, and NP-hard …

computer-science complexity-theory p-np
What is the meaning of O( polylog(n) )? In particular, how is polylog(n) defined?

Brief: When academic (computer science) papers say "O(polylog(n))", what do they mean? I'm not confused by the "Big-Oh" …

algorithm full-text-search compression complexity-theory