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

Re: queue-length should be O(1) ?

This page is part of the web mail archives of SRFI 117 from before July 7th, 2015. The new archives for SRFI 117 contain all messages, not just those from before July 7th, 2015.



You trade off adding a mutation for every element added and removed to the
queue for speeding up queue-length.  I suspect that's not a good trade.
I suspect queue-empty? is far more likely to be used, and that's fast.
Isn't it, then, better not to specify the order so that implementation
may choose how it's implemented at least for this particular procedure?
Or do the orders indicate worst cases?


_/_/
Takashi Kato
E-mail: ktakashi@xxxxxxxxx