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.

Explain the proof by Vinay Deolalikar that P != NP

Recently there has been a paper floating around by Vinay Deolalikar at HP Labs which claims to have proved that …

math computer-science complexity-theory proof p-np
Number of Comparisons in Merge-Sort

I was studying the merge-sort subject that I ran into this concept that the number of comparisons in merge-sort (in …

algorithm merge complexity-theory mergesort
Convert string to number & vice versa complexity

What would be the complexity of converting a string to its equivalent number or vice versa? Does it change depending …

algorithm string complexity-theory math string-conversion
How to calculate order (big O) for more complex algorithms (eg quicksort)

I know there are quite a bunch of questions about big O notation, I have already checked: Plain english explanation …

algorithm complexity-theory big-o
how to determine if the kth largest element of the heap is greater than x

Consider a binary heap containing n numbers (the root stores the greatest number). You are given a positive integer k &…

algorithm complexity-theory binary-heap
General rules for simplifying SQL statements

I'm looking for some "inference rules" (similar to set operation rules or logic rules) which I can use to reduce …

sql logic complexity-theory reduction
What is the complexity of this simple piece of code?

I'm pasting this text from an ebook I have. It says the complexity if O(n2) and also gives an …

java complexity-theory big-o time-complexity stringbuffer
Finding the minimum in an unsorted array in logarithmic time

Is there an algorithmic approach to find the minimum of an unsorted array in logarithmic time ( O(logn) )? Or is …

arrays complexity-theory big-o minimum
Can a program output a copy of itself

I think this might be a classic question but I am not aware of an answer. Can a program output …

algorithm compression complexity-theory quine
Complexity of the memset function in C

I was discussing with some friends a piece of code, and we discussed about using memset function in C, which …

c complexity-theory big-o memset