Though I didn't look into the implementation. I suppose length is a constant time operation here, if you use fold instead to get the same thing. It would be linear time.
Knowing something is empty or not rises after I put something inside and then take something out. Then I dont't know whether there are still something left, so I need to examine it. Or if something can tell me. All is about to be able to have constant time access to specific information in this hash table implementation. 在 2013-2-18,10:47,Daniel Hartwig <[email protected]> 写道: > On 18 February 2013 10:36, Hengqing Hu <[email protected]> wrote: >> Thanks for the collaboration. >> >> You are right, that's what I mean by a deep list. > > So what do you consider the length of the example deep list, is it > two, three, or six? Length implies a particular dimension, which is > naturally the ordering of the outer list. > > Scheme considers: > (length '((1 2 3) (4 5 6))) > => > 2 > > ? > >> >> One usage of knowing the information is to tell >> whether the hash table is empty or not, >> Since a hash-empty? procedure is not provided. > > Yes but, why do you want to know that? Isnt what matters whether a > particular key exists or not, and what is its value? This is the > primary purpose of hash tables, no? > > The number of active bindings in the hash table is really just a book > keeping detail.
