[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pairs(t, skey) and ipairs(t, skey)
- From: Tim Hill <drtimhill@...>
- Date: Sun, 6 Oct 2013 10:59:19 -0700
On Oct 6, 2013, at 6:00 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2013/10/6 Tim Hill <drtimhill@gmail.com>:
>
>>> 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.
>>>
>>
>> I would be interested in seeing a design for 1 or 2 that is O(1).
>
> See attachment.
> <countable.lua>
OK, so that is O(n) .. where is the O(1) example?
--Tim