lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> *   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