redundant
Newbie
- Joined
- May 8, 2004
- Messages
- 349
- Reaction score
- 0
Hey,
Just wondering if anyone could help me out here. I didn't have much luck over at codingforums.com, so if anyone knows any good forums that have a good response rate that'd help me out heaps too...
Anyways, back to the matter at hand. I've got a LinkedList in a Java Class that I'm making and I basically need to go through each item in the list (an object) and apply a method to each of them. Right now my code works, but I'm doing it the same way that i would if it were a normal array - which I know is hell slow for a LinkedList. That is: -
I know that there's a far better way to do this for a linkedList, but I just can't remember. Any help would be much appreciated.
Just wondering if anyone could help me out here. I didn't have much luck over at codingforums.com, so if anyone knows any good forums that have a good response rate that'd help me out heaps too...
Anyways, back to the matter at hand. I've got a LinkedList in a Java Class that I'm making and I basically need to go through each item in the list (an object) and apply a method to each of them. Right now my code works, but I'm doing it the same way that i would if it were a normal array - which I know is hell slow for a LinkedList. That is: -
Code:
for (int i = 0; i<list.size(); i++)
{
apply method to list item here;
}