[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pairs(t, skey) and ipairs(t, skey)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 6 Oct 2013 11:49:35 +0200
2013/10/6 Tim Hill <drtimhill@gmail.com>:
> And in either case, you would still have O(n) performance
I can think of three possible faster-than-O(n) things you could
reasonably accept:
1. Making # mean the number of active keys of whatever class is O(1) worst-case.
2. Making # mean the largest positive integer key you have ever used for this
table is O(1) worst-case.
3. Making # mean the largest positive integer key is O(log(n)) worst-case
if you are willing to accept an O(n) storage penalty.
- References:
- Re: pairs(t, skey) and ipairs(t, skey), Roberto Ierusalimschy
- Re: pairs(t, skey) and ipairs(t, skey), Leo Razoumov
- Re: pairs(t, skey) and ipairs(t, skey), Luiz Henrique de Figueiredo
- Re: pairs(t, skey) and ipairs(t, skey), Tim Hill
- Re: pairs(t, skey) and ipairs(t, skey), Luiz Henrique de Figueiredo
- RE: pairs(t, skey) and ipairs(t, skey), Schmidt, Phil
- Re: pairs(t, skey) and ipairs(t, skey), Javier Guerra Giraldez
- Re: pairs(t, skey) and ipairs(t, skey), Robert Virding
- Re: pairs(t, skey) and ipairs(t, skey), Dirk Laurie
- Re: pairs(t, skey) and ipairs(t, skey), David Heiko Kolf
- Re: pairs(t, skey) and ipairs(t, skey), Tim Hill