Break statement vs Boolean terminate | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Break statement vs Boolean terminate

which is less costly inside the loop ?

10th Nov 2016, 1:48 AM
Pradhumn Sharma
Pradhumn Sharma - avatar
1 Answer
0
A break if you know exactly when it should terminate. Especially helpful in algorithms
14th Nov 2016, 11:08 PM
Arsal Ali
Arsal Ali - avatar