Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-21 Thread Bart Kastermans
On Jun 17, 1:01 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 16 Jun 2008 07:34:06 -0300, Bart Kastermans <[EMAIL PROTECTED]> > escribió: > > > Summary: can't verify big O claim, how to properly time this? > > > This is interesting.  I had never attempted to verify a big O > > state

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Gabriel Genellina
En Mon, 16 Jun 2008 07:34:06 -0300, Bart Kastermans <[EMAIL PROTECTED]> escribió: > Summary: can't verify big O claim, how to properly time this? > > This is interesting. I had never attempted to verify a big O > statement > before, and decided that it would be worth trying. So I wrote some > c

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 12:07 PM, Alex Elder <[EMAIL PROTECTED]> wrote: > I found this article useful when dealing with strings in Python: > >http://www.skymind.com/~ocrow/python_string/ > > It may help squeeze some more time out of your code. 8-) Things seem to have changed since then. I

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 11:30:19 -0600, Ian Kelly <[EMAIL PROTECTED]> wrote: On Mon, Jun 16, 2008 at 11:09 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: It will depend what version of Python you're using and the *exact* details of the code in question. An optimization was introduced where, if

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Alex Elder
I found this article useful when dealing with strings in Python: http://www.skymind.com/~ocrow/python_string/ It may help squeeze some more time out of your code. 8-) Alex. -- http://mail.python.org/mailman/listinfo/python-list

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 11:09 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > It will depend what version of Python you're using and the *exact* details > of the code in question. An optimization was introduced where, if the > string being concatenated to is not referred to anywhere else, it

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Jean-Paul Calderone
On Mon, 16 Jun 2008 10:41:05 -0600, Ian Kelly <[EMAIL PROTECTED]> wrote: On Mon, Jun 16, 2008 at 4:34 AM, Bart Kastermans <[EMAIL PROTECTED]> wrote: This is interesting. I had never attempted to verify a big O statement before, and decided that it would be worth trying. So I wrote some code to

Re: String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Ian Kelly
On Mon, Jun 16, 2008 at 4:34 AM, Bart Kastermans <[EMAIL PROTECTED]> wrote: > This is interesting. I had never attempted to verify a big O > statement > before, and decided that it would be worth trying. So I wrote some > code to > collect data, and I can't find that it goes quadratic. I have th

String Concatenation O(n^2) (was: Re: Explaining Implementing a Binary Search Tree.)

2008-06-16 Thread Bart Kastermans
Summary: can't verify big O claim, how to properly time this? On Jun 15, 2:34 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Bart Kastermans" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > |I wrote a binary search tree in python, explaining as I was doing it > | how and why I d

Re: Explaining Implementing a Binary Search Tree.

2008-06-15 Thread Terry Reedy
"Bart Kastermans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I wrote a binary search tree in python, explaining as I was doing it | how and why I did it. I am very interested in receiving comments on | the code, process, and anything else that will improve my coding or | writin

Explaining Implementing a Binary Search Tree.

2008-06-15 Thread Bart Kastermans
I wrote a binary search tree in python, explaining as I was doing it how and why I did it. I am very interested in receiving comments on the code, process, and anything else that will improve my coding or writing. I wrote this all up in my blog at: http://kasterma.wordpress.com/2008/06/15/implem