[erlang-questions] documentation of data structures

Andras Georgy Bekes bekesa@REDACTED
Fri Dec 7 09:57:25 CET 2007


> I've checked (hopefully) every data structure:
Oh, I've forgotten ets:

The doc clearly states that "constant access time to the data. (In the 
case of ordered_set, see below, access time is proportional to the 
logarithm of the number of objects stored)".

I have a few little problems with this:

- "see below" in the above sentence. I haven't found anything below that 
states something about the implementaion or the complexity of 
operations of ordered_sets, except for one sentence about 
lookup/2: "time is proportional to the (binary) logarithm of the number 
of objects." Isn't this the same as the above?

- "amortized constant access time" would be more appropriate instead 
of "constant access time".

- The doc does not state anything about the difference in cost between 
bag and duplicate_bag. I think bags are more costly, as for each insert 
not only the key has to be matched but the whole structure. But this is 
not stated anywhere therefore I am not sure in this.

- The doc states that set, bag and duplicate_bag work with matching 
while ordered_set does comparing. This is described in detail 4 times 
(!) in the man page, with more-or-less the same words. This should be 
done once somewhere in the beginning of the manpage.

I hope I was constructive enough :-)

	Georgy



More information about the erlang-questions mailing list