General information
Category:
Coding, syntax & commands
Hello James
An alternate solution to implementing this as an array is to implement it as a linked list
Your mediator (or raher your publisher) would hold 3 refrences
the begining of the list, the end of the list and the for the current "node" and each object will have a propety holding reference to the next in line
Adding a new object is o(1) (you can verify that an object is not already in the chain by checking its refrence property - or another)
removing an object from the chain is o(n) to find it and o(1) to actually remove it
and scanning through the whole chain is also o(n)
HTH
Arnon
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only