[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Virgin tables
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 30 Dec 2010 09:23:19 -0200
> * It's an O(1) function. Virginity is lost by t[k]=nil for
> k<#t and by t[k]=non_nil for k>#t+1, both easy to test.
How is it O(1)? Do you have a sample implementation?
> * #t would be O(1) for all virgin tables. (At present, many
> numeric entries may actually reside in the hash part of the
> table, and then #t takes O(log n) time.)
Like I said before, full arrays can have part of their data stored
in the hash part:
http://lua-users.org/lists/lua-l/2010-12/msg00400.html