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.

Linear time v.s. Quadratic time

Often, some of the answers mention that a given solution is linear, or that another one is quadratic. How to …

python big-o complexity-theory time-complexity
Time Complexity of two for loops

So I know that the time complexity of: for(i;i<x;i++){ for(y;y<x;y++){ //…

algorithm complexity-theory big-o
c++ - unordered_map complexity

I need to create a lookup function where a (X,Y) pair corresponds to a specific Z value. One major …

c++ hashtable complexity-theory unordered-map
2^n complexity algorithm

I need to implement and test an algorithm with a 2^n complexity. I have been trying to find one for …

algorithm complexity-theory analysis
Time complexity of unshift() vs. push() in Javascript

I know what is the difference between unshift() and push() methods in JavaScript, but I'm wondering what is the difference …

javascript arrays time push complexity-theory
Solve the recurrence: T(n)=2T(n/2)+n/logn

I can find the sum of each row (n/log n-i) and also I can draw its recursive tree but …

time complexity-theory recurrence
What's faster: inserting into a priority queue, or sorting retrospectively?

What's faster: inserting into a priority queue, or sorting retrospectively? I am generating some items that I need to be …

c++ sorting complexity-theory priority-queue
What guarantees are there on the run-time complexity (Big-O) of LINQ methods?

I've recently started using LINQ quite a bit, and I haven't really seen any mention of run-time complexity for any …

c# .net linq algorithm complexity-theory
Are 2^n and n*2^n in the same time complexity?

Resources I've found on time complexity are unclear about when it is okay to ignore terms in a time complexity …

algorithm big-o complexity-theory time-complexity
What is Big O notation? Do you use it?

What is Big O notation? Do you use it? I missed this university class I guess :D Does anyone use …

optimization complexity-theory big-o