Top "Time-complexity" questions

The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the size of the input to the problem.

What is the time complexity of std::sort() in the C++ standard library?

What is the complexity of std::sort() in the C++ Standard Library? Which sort is applied? Is there any rule …

c++ stl time-complexity
How to calculate time complexity of backtracking algorithm?

How to calculate time complexity for these backtracking algorithms and do they have same time complexity? If different how? Kindly …

algorithm complexity-theory time-complexity backtracking
How do I find the median of numbers in linear time using heaps?

Wikipedia says: Selection algorithms: Finding the min, max, both the min and max, median, or even the k-th largest element …

algorithm heap time-complexity median
Time complexity of Sieve of Eratosthenes algorithm

From Wikipedia: The complexity of the algorithm is O(n(logn)(loglogn)) bit operations. How do you arrive at that? …

algorithm performance time-complexity sieve-of-eratosthenes
Is there an O(n) integer sorting algorithm?

The last week I stumbled over this paper where the authors mention on the second page: Note that this yields …

algorithm language-agnostic sorting time-complexity
What is the complexity of these Dictionary methods?

Can anyone explain what is the complexity of the following Dictionary methods? ContainsKey(key) Add(key,value); I'm trying to …

c# complexity-theory time-complexity
Will Arrays.sort() increase time complexity and space time complexity?

There is an array related problem, the requirement is that time complexity is O(n) and space complexity is O(1). …

java arrays sorting time-complexity space-complexity
Time complexity of a recursive algorithm

How can I calculate the time complexity of a recursive algorithm? int pow1(int x,int n) { if(n==0){ return 1; } …

c algorithm time-complexity
Why is the time complexity of python's list.append() method O(1)?

As seen in the documentation for TimeComplexity, Python's list type is implemented is using an array. So if an array …

python python-2.7 time-complexity amortized-analysis
Example of a factorial time algorithm O( n! )

I'm studying time complexity in school and our main focus seems to be on polynomial time O(n^c) algorithms …

algorithm complexity-theory time-complexity factorial