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.

Solving the recurrence T(n) = T(n / 2) + O(1) using the Master Theorem?

I'm trying to solve a recurrence relation to find out the complexity of an algorithm using the Master Theorem and …

algorithm complexity-theory big-o recurrence master-theorem
Why is the complexity of A* exponential in memory?

Wikipedia says on A* complexity the following (link here): More problematic than its time complexity is A*’s memory usage. …

algorithm artificial-intelligence graph complexity-theory a-star
Fastest algorithm for computing the determinant of a matrix?

For a research paper, I have been assigned to research the fastest algorithm for computing the determinant of a matrix. …

algorithm matrix complexity-theory linear-algebra determinants
Calculating the Recurrence Relation T(n)=T(n-1)+logn

We are to solve the recurrence relation through repeating substitution: T(n)=T(n-1)+logn I started the substitution and …

recursion big-o complexity-theory recurrence
why does accessing an element in an array take constant time?

Lets say I have an array as: int a[]={4,5,7,10,2,3,6} when I access an element, such as a[3], what does actually …

c arrays time constants complexity-theory
How to improve Cyclomatic Complexity?

Cyclomatic Complexity will be high for methods with a high number of decision statements including if/while/for statements. So …

c# design-patterns complexity-theory cyclomatic-complexity
How is the implementation of LinkedHashMap different from HashMap?

If LinkedHashMap's time complexity is same as HashMap's complexity why do we need HashMap? What are all the extra overhead …

java hashmap complexity-theory linkedhashmap
A Regex that will never be matched by anything

This might sound like a stupid question, but I had a long talk with some of my fellow developers and …

regex dictionary complexity-theory
Java: what's the big-O time of declaring an array of size n?

What is the running time of declaring an array of size n in Java? I suppose this would depend on …

java arrays complexity-theory performance
Why does heap sort have a space complexity of O(1)?

I understand that both quick sort and merge sort need O(n) auxiliary space for the temporary sub-arrays that are …

sorting complexity-theory time-complexity