## gotto Newbie Poster

I am given the amount of data and the time used. It asks for the time complexity. It is in a Big-O packet
Below is the first problem given

``````Algorithm A
Data     Time
1000     .003
2000     .012
4000     .048
8000     .192
``````

Please explain how to get the time complexity. Thanks!

## deceptikon 1,790

As the data doubles, how does the time used scale? That's your complexity.

## gotto

Would it be in a Big-O format though?

## deceptikon 1,790

Of course not. You'll need to think a little bit and infer the big O notation out of it. For example, if the time doubles along with the data, that's O(N). If it squares each time, that's O(N^2).

## Taywin 312

And if it is between O(n) and O(n^2), you can use O(nlogn)... But watch out for O(cn) because it is the same as O(n)...

## gotto

Thanks. Now on the last one there is not a pattern of increasing. Data is the same, but the time is: .0030, .0066, .0142, .3256

I even went into how much it could multiply by to get the next time.

## Taywin 312

That would be very simple. Think as the data is n, and the time is whatever the increment type is. That will be your answer.

Thanks. :)