O(n^2) is bad - can it be fixed?

Courageous jkraska1 at san.rr.com
Tue May 22 03:32:45 EDT 2001


>The test with the list runs very swiftly and smoothly - the numbers
>are printed out at a steady rate. The test with the string runs
>slowly, ...

The correct thing to do if performance becomes important
to you in this context is to convert the string to a list,
manipulate it as a list, and then convert it back to a string.


C//




More information about the Python-list mailing list