tags:

views:

475

answers:

2

I have probem / strange question, i got algorithm with few "for" loops and now i need to do block scheme of this algorithm.

I know how to picture "while" loop, but is this acceptable to represent "for" loop using "while" and at this point make difference between souce code and algorithm?. Ofcourse assuming that all "for" loops are right in place and using loop of any other kind would produce unnecessary code which i avoided using "for" loops.

I'm guessing that this is rather impossible (at least I can't imagine this) to simply picture "for" loop, but maybe there is a way (if exists).

Thanks in advance

A: 

What's a "block scheme"?

If I were drawing it, I might draw a box with "for each x in y" written in it.

If you're drawing a flowchart, there's always a loop with a decision box.

Nassi-Schneiderman diagrams have a loop construct you could use.

Charlie Martin
Sorry my english isn't so great, but i hpoe you got idea what i mean
MoreThanChaos
+2  A: 
Bill the Lizard
It is so obvious, i didn't realized it till i saw solution, probably it would came by itself when i would start to picturing my algorithm, THANKS
MoreThanChaos
Sure, no problem. Sometimes it's just reassuring to see that others are thinking along the same lines.
Bill the Lizard