[EMAIL PROTECTED] (Roy Smith) wrote:

>O(n^0), which is almost always written as O(1).  This is a "constant
>time" algorithm, one which takes the same amount of steps to execute
>no matter how big the input is.  For example, in python, you can
>write, "x = 'foo'".  That assignment statement takes the same amount
>of time no matter how long the string is.  All of these execute in the
>same number of steps:
>
>       x = ''
>       x = 'foo'
>       x = 'a very long string with lots and lots of characters'
>
>We can say that "assignment is constant time", or "assignment is
>O(1)".

Constant time if converted to byte code or compiled?

O(n) in string length if being interpreted?
--
Regards,
Casey
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to