Re: Time Complexity of String Operations

2008-07-22 Thread youtoo
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 immutab

Time Complexity of String Operations

2008-07-21 Thread youtoo
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