Why are optimised for loops not discussed? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why are optimised for loops not discussed?

22nd Oct 2016, 3:07 AM
Nicholas Schnorr
2 Answers
+ 4
There is an enhanced for loop section in the course. Check out the Arrays module!
3rd Nov 2016, 7:14 AM
James Flanders
0
I think the OP meant some speed optimization regarding for loops. If that is the case, it is a subject way of out scope with respect to the level of a SoloLearn course. Anyway, just to get you started, two possible optimizations are loops unrolling ( http://stackoverflow.com/questions/2349211/when-if-ever-is-loop-unrolling-still-useful) and reverse loops ( https://www.mkyong.com/java/reverse-loop-versus-forward-loop-in-performance-java/). Check out also http://www.javaworld.com/article/2077647/build-ci-sdlc/make-java-fast--optimize-.html
9th Nov 2016, 8:32 AM
Giulio Pellitta
Giulio Pellitta - avatar