At Thu, 18 Sep 2008 10:00:15 +0100, Marcin Tustin wrote:
Would this be O(n^2) to remove all nils?
Not in a way it matters. OrderedCollection moves items not eagarly.
In any case, if this is a conveyor belt, then you should almost certainly be using a linke data structure, and iterate over the structure to delete the unwanted links.
No in two reasons; 1) he wasn't talking about removing items in the middle and 2) OrderedCollection is usually more efficient than the naive LinkedList, as less dereferencing. (And, it could get more benefits from using array manipulation primitives like replaceFrom:to:, but it can't at least for addFirst:.)
-- Yoshiki