r/CircleProgramming • u/Illuminatesfolly • Mar 21 '13
How do I make this code faster without loosing the function?
http://pastebin.com/ie9XTrc7
3
Upvotes
r/CircleProgramming • u/Illuminatesfolly • Mar 21 '13
View all comments
Show parent comment
1
u/cokeisahelluvadrug Mar 22 '13
That's interesting. I assume by "#" you're calling list.size() or something similar. If you're not aware, what you're actually doing is swapping out usage of "index" values for "iterators" -- iterators are little objects that let you iterate through the elements of a container, and all good containers in Java use them.
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html
is actually equivalent to: