> +1. > OrderedCollection's addLast/removeFirst/removeLast, is enough to use > them as lists. > > About performance, i am little concerned. > Linked lists is good , that is costs you a constant time for each new > element you adding. > While for OrderedCollections it vary depending on container state. In > most cases, it costs you as little as for linked lists, but when > contained is not big enough to hold all elements - then it has to grow > and consuming a lot more time comparing to adding a previous element. >
Given that the amortized cost is still O(1) per add or remove when using OrderedCollections I think the cost of the grows can be ignored unless the OrderedCollections are so large as to cause memory or memory management problems or if your algorithm is real time and cannot tolerate the occasional slowdown during a grow operation. In the latter situation I ask: why are you using an automatic garbage collected language such as Smalltalk? I expect the performance of OrderedCollections used as stacks or queues to be good compared to linked lists. Regards, Ralph Boland -- Quantum Theory cannot save us from the tyranny of a deterministic universe but it does give God something to do _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project