Remove first 'n' elements from list without itterating
Posted
by
Eldhose M Babu
on Stack Overflow
See other posts from Stack Overflow
or by Eldhose M Babu
Published on 2012-09-17T09:15:38Z
Indexed on
2012/09/17
9:37 UTC
Read the original article
Hit count: 372
I need an efficient way of removing items from list. If some condition happens, I need to remove first 'n' elements from a list. Can some one suggest the best way to do this? Please keep in mind: performance is a factor for me, so I need a faster way than itterating. Thanks.
I'm thinking of a way through which the 'n'th item can be made as the starting of the list so that the 0-n items will get garbage collected. Is it possible?
© Stack Overflow or respective owner