Complexity question on Python 3 lists

Ian Kelly ian.g.kelly at gmail.com
Wed Feb 15 23:54:27 CET 2012


On Wed, Feb 15, 2012 at 1:28 PM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
> On Wed, 15 Feb 2012 11:11:27 -0800, Chris Rebert <clp2 at rebertia.com>
> wrote:
>
>
>>"The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, …"
>>    -- list_resize()
>>
>        Rather perverse, is it not? The first set is plain doubling, but
> then you get a series of increases by:
>
>        ... 9, 10, 11, 12, 14, 16, 16,...
>
> or
>
>        100%, 100%, 100%, 56%, 40%, 34%, 30%, 27%, 22%,...
>
>        Big jump form 100% to 56%...

Based on the formula in the code, it would seem to asymptotically
approach 12.5%.



More information about the Python-list mailing list