Le mardi 21 août 2012 09:52:09 UTC+2, Peter Otten a écrit :
> wxjmfa...@gmail.com wrote:
>
>
>
> > By chance and luckily, first attempt.
>
>
>
> > c:\python32\python -m timeit "('€'*100+'€'*100).replace('€'
>
> > , 'œ')"
>
> > 100 loops, best of 3: 1.48 usec per loop
>
> > c:\python33
On Mon, 20 Aug 2012 11:12:22 -0600, Ian Kelly wrote:
> On Mon, Aug 20, 2012 at 10:09 AM, Chris Angelico
> wrote:
>> On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin
>> wrote:
>>> Analogy: how big a box is required to hold a pair of shoes? In a
>>> purely theoretical sense we might say O(S) where S i
wxjmfa...@gmail.com wrote:
> By chance and luckily, first attempt.
> c:\python32\python -m timeit "('€'*100+'€'*100).replace('€'
> , 'œ')"
> 100 loops, best of 3: 1.48 usec per loop
> c:\python33\python -m timeit "('€'*100+'€'*100).replace('€'
> , 'œ')"
> 10 loops, best of 3: 7.62 usec p
In article ,
wxjmfa...@gmail.com wrote:
> Note
> The used characters are not members of the latin-1 coding
> scheme (btw an *unusable* coding).
> They are however charaters in cp1252 and mac-roman.
mac-roman is an obsolete encoding that was used in MacOS 9 and MacOS
Classic systems of previous d
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道:
> Ian Kelly writes:
>
> > The difference between the two is that the former is bounded by a
>
> > constant that is fundamental to the algorithm at hand,... S is
>
> > clearly bounded by the constraints of actual shoes, so we can safely
>
> > treat S
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道:
> Ian Kelly writes:
>
> > The difference between the two is that the former is bounded by a
>
> > constant that is fundamental to the algorithm at hand,... S is
>
> > clearly bounded by the constraints of actual shoes, so we can safely
>
> > treat S
Ian Kelly writes:
> The difference between the two is that the former is bounded by a
> constant that is fundamental to the algorithm at hand,... S is
> clearly bounded by the constraints of actual shoes, so we can safely
> treat S as a constant and call it O(N).
Thanks, that is a good explain o
By chance and luckily, first attempt.
IDLE, Windows 7.0 Pro 32, Pentium Dual Core 2.6, RAM 2 Go
Py 3.2.3
>>> timeit.repeat("('€'*100+'€'*100).replace('€', 'œ')")
[1.6939567134893707, 1.672874290786993, 1.6761219212298073]
Py 3.3.0b2
>>> timeit.repeat("('€'*100+'€'*100).replace('€', 'œ')")
[7.924
On Mon, Aug 20, 2012 at 10:09 AM, Chris Angelico wrote:
> On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin wrote:
>> Analogy: how big a box is required to hold a pair of shoes? In a purely
>> theoretical sense we might say O(S) where S is the shoe size, treating
>> shoe size as an arbitrary independe
On 20 August 2012 17:01, Paul Rubin wrote:
> Oscar Benjamin writes:
> > No it doen't. It is still O(k). The point of big O notation is to
> > understand the asymptotic behaviour of one variable as it becomes
> > large because of changes in other variables.
>
> Actually, two separate problems got
On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin wrote:
> Analogy: how big a box is required to hold a pair of shoes? In a purely
> theoretical sense we might say O(S) where S is the shoe size, treating
> shoe size as an arbitrary independent variable. But in the real world,
> shoe size is controlled
Oscar Benjamin writes:
> No it doen't. It is still O(k). The point of big O notation is to
> understand the asymptotic behaviour of one variable as it becomes
> large because of changes in other variables.
Actually, two separate problems got mixed together late at night. In
neither case is k an
On Sun, 19 Aug 2012 16:42:03 -0700, Paul Rubin
wrote:
Steven D'Aprano writes:
> Of course *if* k is constant, O(k) is constant too, but k is not
> constant. In context we are talking about string indexing and
slicing.
> There is no value of k, say, k = 2, for which you can say "People
will
Steven D'Aprano writes:
> Of course *if* k is constant, O(k) is constant too, but k is not
> constant. In context we are talking about string indexing and slicing.
> There is no value of k, say, k = 2, for which you can say "People will
> sometimes ask for string[2] but never ask for string[3]"
On Sun, 19 Aug 2012 10:48:06 -0700, Paul Rubin wrote:
> Terry Reedy writes:
>> I would call it O(k), where k is a selectable constant. Slowing access
>> by a factor of 100 is hardly acceptable to me.
>
> If k is constant then O(k) is the same as O(1). That is how O notation
> works.
You might
15 matches
Mail list logo