Control flow graph

Asked

Viewed 131 times

1

I’m having second thoughts about Graph of Control Flow.
It is requested for the code below the control flow graph.

exemplo de código

I did it that way:

Foto com um grafo

  • That node 7 is really necessary?

inserir a descrição da imagem aqui

Exercise 2 I commented:

  • I think both 4 and 5 would go back to 2...

  • Now, of course, it would be more readable 4 and 5 going to 6, and 6 going to 2, without needing 7. Apparently there in this flow graph the 6 would be a "no-op" of its above algorithm

  • So that seven could be disposed of without a problem... I have another exercise that the code is very similar to that ,only in the while part there are two conditions that is like this: while((a<0) or (b<-2)) in which case I would have to separate each while condition into a new node? (I’ll see if I can print out the exercise).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.