Exercise 3: Why Three Nested Loops Would Be a Bad Flowchart Candidate — Possible Solution ==================================================================== WHAT HAPPENED WITH JUST ONE LOOP ------------------------------ This chapter's own FindMax diagram needed a single loop-back arrow that traveled all the way from the bottom of the diagram, out to the far left edge, up past every other shape, and back in to the top decision diamond - a long path specifically needed to physically route around every other shape already occupying the space in between, without crossing any other line. The chapter also noted this same seven-line pseudocode algorithm expanded into eleven separate shapes once drawn, just to represent one loop and two decision points. WHY A SECOND NESTED LOOP MAKES THIS WORSE, NOT JUST BIGGER ------------------------------ A loop nested inside another loop needs its own separate loop-back arrow, positioned entirely INSIDE the outer loop's own loop-back path - the inner loop's arrow now has to route around the outer loop's own arrow as well as every process/decision shape belonging to both loops, without the two loop-back arrows crossing each other in a way that makes the diagram ambiguous to follow. This isn't simply "twice as many shapes" - the ROUTING problem gets harder combinatorially, since each additional loop-back arrow has to be threaded through more existing geometry without creating a visually confusing tangle. WHY THREE NESTED LOOPS COMPOUNDS THIS FURTHER ------------------------------ A third, innermost loop needs its own loop-back arrow nested inside both of the first two - by this point, the diagram needs at least three concentric, non-crossing loop-back paths, each routed around increasingly more shapes and around each other's own arrows. Even before considering how many individual process and decision shapes the three loops' own bodies would add, just the loop-back arrows alone would very likely need to be routed so far apart (to avoid visually overlapping or crossing) that the diagram becomes far wider or taller than a single page can reasonably show, which is exactly the "doesn't scale" symptom this chapter's own single-loop example already began to demonstrate at a much smaller scale. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation connects the three-nested-loop scenario directly back to the specific routing challenge (a loop-back arrow needing to avoid crossing other shapes) that this chapter's own single-loop diagram already demonstrated concretely, and explains why nesting compounds the problem rather than just linearly scaling it, rather than only asserting that "more loops are worse" without tracing the actual mechanism.