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.

Efficiently find all connected induced subgraphs

Is there an efficient(*) algorithm to find all the connected (induced) subgraphs of a connected undirected vertex-labelled graph? (*) I appreciate …

algorithm graph time-complexity complexity-theory graph-algorithm
Big-O time complexity for this recursive Fibonacci?

I have a program that prints Fibonacci Series using Recursion. There are better methods for it, but I was asked …

time-complexity big-o complexity-theory asymptotic-complexity code-complexity
Catalan Numbers, Recursive function time complexity

The following function produces the nth number in catalan numbers. What is the exact time complexity function of this function …

c++ algorithm time-complexity catalan
Computational complexity of a longest path algorithm witn a recursive method

I wrote a code segment to determine the longest path in a graph. Following is the code. But I don't …

recursion big-o time-complexity longest-path
Memoization algorithm time complexity

I read this article Retiring a Great Interview Problem, the author came up with a work break problem and gave …

algorithm recursion time-complexity memoization
Scenarios for selection sort, insertion sort, and quick sort

If anyone can give some input on my logic, I would very much appreciate it. Which method runs faster for …

sorting time-complexity quicksort insertion-sort selection-sort
std::set erase complexity anomality?

I am trying to figure out the complexity of erasing multiple elements from std::set. I am using this page …

c++ stl time-complexity stdset
If P=NP then how we can we say P=NP=NP-complete?

In wikipedia I found this diagram. I don't get how under the asumption p=np we get p=np=np-complete?

algorithm time-complexity np
Update the average of a continuous sequence of numbers in constant time

How can you add and subtract numbers in an average without having to iterate through the entire list? This can …

performance math iteration time-complexity average