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 pseudopolynomial time? How does it differ from polynomial time?

What is pseudopolynomial time? How does it differ from polynomial time? Some algorithms that run in pseudopolynomial time have runtimes …

algorithm big-o time-complexity
How is LinkedList's add(int, E) of O(1) complexity?

From the linked-list tag wiki excerpt: A linked list is a data structure in which the elements contain references to …

java linked-list big-o time-complexity
why is the time complexity of bubble sort's best case being O(n)

I deduced the time complexity of bubble sort in its best case according to the mothod used in book ALGORITHMS 2.2. …

time-complexity bubble-sort
What is time complexity of a list to set conversion?

I've noticed the table of the time complexity of set operations on the python official website. But i just wanna …

python list hash set time-complexity
What is the time complexity of a size() call on a LinkedList in Java?

As the title asks, I wonder if the size() method in the LinkedList class takes amortized O(1) time or O(…

java size linked-list time-complexity
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
Real world examples to decide which sorting algorithm works best

I am risking this question being closed before i get an answer, but i really do want to know the …

algorithm sorting time-complexity space-complexity
What is the time complexity of the sleep sort?

Given this sort algorithm how do you express its time complexity? Originally presented here (partial archive). #!/bin/bash function f() { …

time-complexity
What is the time complexity of k-means?

I was going through the k-means Wikipedia page. Based on the algorithm, I think the complexity is O(n*k*…

algorithm time-complexity k-means
Time Complexity of Insertion Sort

Could anyone explain why insertion sort has a time complexity of Θ(n²)? I'm fairly certain that I understand time complexity …

sorting time-complexity insertion-sort