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.

Is the complement of any context free language context free?

I read multiple answers that state if a language is not context free, then its complement is context free (correct …

complexity-theory context-free-grammar formal-languages context-free-language
Programmatically obtaining Big-O efficiency of code

I wonder whether there is any automatic way of determining (at least roughly) the Big-O time complexity of a given …

algorithm complexity-theory
Lower bound on heapsort?

It's well-known that the worst-case runtime for heapsort is Ω(n lg n), but I'm having trouble seeing why this is. …

algorithm complexity-theory big-o heapsort lower-bound
Breaking a string apart into a sequence of words

I recently came across the following interview question: Given an input string and a dictionary of words, implement a method …

algorithm search search-engine complexity-theory
A* time complexity

Wikipedia says the following on A*'s complexity: The time complexity of A* depends on the heuristic. In the worst …

complexity-theory a-star
Time complexity versus space complexity in Turing machines

I think defenitions of time complexity and space complexity for Turing machines are identical and I can't differentiate between them. …

algorithm complexity-theory time-complexity turing-machines space-complexity
Are games the most complex / impressive applications?

I was thinking today about what could be the most complex / impressive application ever written. So I started thinking of …

artificial-intelligence complexity-theory
How do we determine the time and space complexity of minmax?

I am having some trouble determining space and time complexities. For example, if I have a tree that has a …

artificial-intelligence big-o complexity-theory minimax
How is it possible to build a suffix tree in linear time?

To build a suffix tree, in the worst case if all the letter of the string are different the complexity …

algorithm data-structures complexity-theory big-o suffix-tree
Missing number(s) Interview Question Redux

The common interview problem of determining the missing value in a range from 1 to N has been done a thousand …

c++ math computer-science complexity-theory