[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.2 work3 manual
 
- From: Javier Guerra Giraldez <javier@...>
 
- Date: Tue, 25 May 2010 01:25:03 +0100
 
On Sun, May 23, 2010 at 10:09 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> Your definition requires an O(n) search to evaluate #x, whereas Lua's
>> definition allows an O(log n) search.
>
> Not really, you could use balanced binary trees or Judy trees, which
> would bring you down to O(log n).  On the other hand, I'm sure that
> the constants would be far worse than the current implementation.
and a reverse linked list could keep it at O(1); but all these assume
maintaining extra structure and keep it current on every assignment.
-- 
Javier
- 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