Showing nested for loops in a flowchart
26,825
This is what you are looking for.
You can see other interesting flowchart for nested loops here.
Related videos on Youtube
Comments
-
M. Salman Khan almost 2 years
How could I show a nested loop in a flowchart?
I want to show a nested foreach loop in a flowchart that shows something like this
foreach($array as $item) { foreach($SecondArray as $key=>$value) { // Do stuff... } }
Now correct me if I'm wrong, but there is no way to show a foreach loop in a flowchart, so I'd need to show a for loop in the diagram(?) So the algorithm should be shown as something more like:
for ($i = 0; $i < count($array); i++) { for ($j = 0; $j < count($arrayTwo); $j++) { // Do stuff... } }
Now looking at the answers to this question (How to picture “for” loop in block representation of algorithm), a single for loop could be shown like this:
But I cannot think of any way in which I could show a nested loop (to show the code I wrote above).
Any suggestions?
-
M. Salman Khan almost 7 yearsThank you. That was so obvious it kinda hurts haha. May I just asked if you used LaTeX to create that diagram by any chance?
-
Shridhar R Kulkarni almost 7 yearsI actually took it from the link mentioned at the bottom in the answer. To draw the easy flowcharts I have used draw.io till now.
-
M. Salman Khan almost 7 yearsAhh, didn't see that there haha. Well thanks for your help! :)