views:

34

answers:

1

I am not sure if you can post revision programming questions in here but i am stuck with some algorithms revision

If an algorithm is quadratic it takes time proportional to the number of n^2 ?

So if the slides say its almost 1/2 the square of n records is this the same as saying (n^2 * 0.5)

Thanks

A: 

The complexity of an algorithm with quadratic time is O(N^2).

If it's half that, then the complexity is O((N-1)^2). In this case, the -1 is not reduced further since it has a huge impact on the runtime for large values of N.

Aaron Digulla