O(n^2) is bad - can it be fixed?
Isaac To Kar Keung
kkto at csis.hku.hk
Tue May 22 22:47:48 EDT 2001
>>>>> "Ben" == Ben Hutchings <ben.hutchings at roundpoint.com> writes:
Ben> As the list buffer grows, realloc() will at some point find that
Ben> the only place to put it is at the top of the heap. Once it's
Ben> there, further realloc() calls will grow the heap and will not need
Ben> to move the buffer. However, other systems - those with a shared
Ben> memory space, or without a smart implementation of realloc() - are
Ben> likely to behave differently.
Yes, I postulated that before. But it is proven otherwise by my last
example. (Did you see why I have two arrays growing rather than just one?)
Regards,
Isaac.
More information about the Python-list
mailing list