Think Python: How to Think Like a Computer Scientist

(singke) #1

proportional to the size of the input, n, and Algorithm B tends to be proportional to n^2 ,
then I expect A to be faster than B, at least for large values of n.


This kind of analysis comes with some caveats, but we’ll get to that later.

Free download pdf