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.

Triplet whose sum in range (1,2)

Given n positive real numbers in an array, find whether there exists a triplet among this set such that, the …

arrays algorithm math time-complexity space-complexity
How is the complexity of PCA O(min(p^3,n^3))?

I've been reading a paper on Sparse PCA, which is: http://stats.stanford.edu/~imj/WEBLIST/AsYetUnpub/sparse.pdf And …

matrix machine-learning time-complexity pca
For inputs of size n, for which values of n does insertion-sort beat merge-sort?

In the book Introduction to Algorithms (Corman), exercise 1.2-2 asks a the following question about comparing implementations of insertion sort …

algorithm sorting time-complexity mergesort insertion-sort
Running Time of GCD Function Recursively (Euclid Algorithm)

I have only been able to find posts about how to implement the gcd function both recursively and iteratively, however …

c runtime time-complexity recurrence greatest-common-divisor
NLTK tokenize - faster way?

I have a method that takes in a String parameter, and uses NLTK to break the String down to sentences, …

python time-complexity nltk tokenize frequency
Object.keys() complexity?

Anyone know the time-complexity of ECMAScript5's Object.keys() in common implementations? Is it O(n) for n keys? Is …

javascript performance time-complexity ecmascript-5
Can someone help solve this recurrence relation?

T(n) = 2T(n/2) + 0(1) T(n) = T(sqrt(n)) + 0(1) In the first one I use substitution method for n, logn, …

algorithm math time-complexity recurrence
Training complexity of Linear SVM

Which is the actual computational complexity of the learning phase of SVM (let's say, that implemented in LibSVM)? Thank you

time-complexity svm libsvm
What is the space complexity of a recursive fibonacci algorithm?

This is the recursive implementation of the Fibonacci sequence from Cracking the Coding Interview (5th Edition) int fibonacci(int i) { …

java algorithm recursion time-complexity space-complexity
Count the number of Ks between 0 and N

Problem: I have seen questions like: count the number of 0s between 0 and N? count the number of 1s between 0 …

algorithm numbers range time-complexity counting