What is a 'Nested Loop'?

Asked by kemiadewale · 6 months ago

1 Answer

2
amorebise · 6 months ago Top Answer

This is a loop inside a loop. Imagine for every day of the week, you drink three cups of water. The day loop runs 7 times, and the water loop runs 3 times for each day.

They are powerful but can be slow. If you have 1,000 items and you put another loop of 1,000 inside it, that's a million operations! Always think about efficiency.

Log in to add a comment.