[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.2 work3 manual
- From: "Juris Kalnins" <juris@...>
- Date: Tue, 25 May 2010 16:49:25 +0300
On Tue, 25 May 2010 16:23:20 +0300, Tony Finch <dot@dotat.at> wrote:
On Tue, 25 May 2010, Juris Kalnins wrote:
When resizing array part, link all nil nodes into firstNil list;
then #t is:
*firstNil ? #t == array - firstNil : sizearray;
And you have O(1) #t, plus amortized O(1) cost of list upkeep.
Not if you need to insert a nil in the middle of the list.
Hmm, right, but it still doesn't affect the cost of #t ;)
And non-pathological inserting of nil is not O(n), either.
(If there are "few" holes, you can find nil, closest to
the position of the new nil "fast" by traversing the list.
If there are "many", by randomly probing the nodes in the
yet-not-traveled range. Search that does this in parallel
_i_think_ is faster than O(n)).
- References:
- Re: 5.2 work3 manual, Luiz Henrique de Figueiredo
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Duncan Cross
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Roberto Ierusalimschy
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Gavin Wraith
- Re: 5.2 work3 manual, Tony Finch
- Re: 5.2 work3 manual, Florian Weimer
- Re: 5.2 work3 manual, Javier Guerra Giraldez
- Re: 5.2 work3 manual, Tony Finch
- Re: 5.2 work3 manual, Juris Kalnins
- Re: 5.2 work3 manual, Tony Finch