I am sorry if these are such stupid noob questions. I am just getting into CS.
I read a passage in a book that says:
Time complexity is written T(n). It gives the number of operations the algorithm performs when processing an input of size n. We also refer to an algorithm’s T(n) as its running cost. If our code follows T(n) = n2, we can predict how much longer it takes to sort a deck once we double its size:
- Firstly, why does our code follow T(n) = n2 ? I don't get why we make that assumption
- I do not understand what this means, n2 means squared, correct? so if
T(8) = 64, right?
- Next we have the
T(2n)/T(n) = 4, lets say
T(4)/T(2) = 2, right?
Again I am a noob so please be gently and I would really appreciate detailed answers. Thank you