algorithm Detected loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

algorithm Detected loop

the algorithm for summing the salaries of N employees presented in the text performs a loop that consists of adding one salary to the total and advancing a pointer on the employee list N-1 times. the last salary is added separately. what is reason for visit? why dont we perform the loop N times?

30th Nov 2020, 3:25 AM
Bago Go58
Bago Go58 - avatar
1 Answer
+ 1
Hi there, I would like to help you out. But please link your code with this question.
30th Nov 2020, 4:04 AM
Steve Sajeev
Steve Sajeev - avatar