On 22 jul, 01:39, "David Wahler" <[EMAIL PROTECTED]> wrote:
> On Mon, Jul 21, 2008 at 10:31 PM, youtoo <[EMAIL PROTECTED]> wrote:
> > It has been extensively discussed the time complexity (quadratic) of
> > string concatenation (due to string's immutability).
>
> Actually, it is roughly linear, at
youtoo wrote:
It has been extensively discussed the time complexity (quadratic) of
string concatenation (due to string's immutability).
But what is:
== the time complexity of string indexing? Is it constant?
== the time complexity of string slicing? Is it O(K) with K the
slice's length?
How a
On Mon, Jul 21, 2008 at 10:31 PM, youtoo <[EMAIL PROTECTED]> wrote:
> It has been extensively discussed the time complexity (quadratic) of
> string concatenation (due to string's immutability).
Actually, it is roughly linear, at least for reasonable string lengths:
$ python -V
Python 2.5.2
$ pyth
It has been extensively discussed the time complexity (quadratic) of
string concatenation (due to string's immutability).
But what is:
== the time complexity of string indexing? Is it constant?
== the time complexity of string slicing? Is it O(K) with K the
slice's length?
How are strings stored