<div class="gmail_quote">On Fri, Apr 30, 2010 at 9:16 PM, Jimbo <span dir="ltr"><<a href="mailto:nilly16@yahoo.com">nilly16@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello I have a relatively simple thing to do; move an object from one<br>
to list into another. But I think my solution maybe inefficient &<br>
slow.<br></blockquote><div><br>Removing an item from a list is O(n) on average, so it's going to be a bit slow any way you slice it (unless you only remove from the end of the list which is O(1)).<br><br>Can you tell us more about why you're using a list? If the order of the items doesn't matter, you may be able to use a set(). <br>
<br>If the order matters, how is the list ordered? If we know how the list is ordered, we may be able to help you come up with a clever way to remove an item cheaply.<br></div></div><div style="margin: 2em 0pt;" name="sig_2341e11ee1">
--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</div><br>