comp-think/2019-2020

Lecture "Algorithms", exercise 1

Opened this issue Β· 10 comments

What is the result of the execution of the algorithm in Figure 4 using "Peroni", "HTML", and "Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. DOI: https://doi.org/10.7717/peerj-cs.132" as input values?

The result is 2.

Result = 2

The result is 2

2!

Result = 2
flow1

The result is 2

Result is 2

@ariannamorettj

Your approach works, but it is unclear the use you have done of the diagram since in the input widget you actually specified the actual input used for the particular execution of the algorithm. Now, of course, you can use a flowchart to mimic the execution of the algorithm, but in this case, I would strongly suggest drawing only the widgets that are really used. For instance, I would avoid drawing the line "no" between the first decision widget and the second, as well as the line "no" of the second decision widget. In this way, you have a linear execution of all the passages, that avoid possible confusion.

I hope it may help.

@essepuntato I tried to take Arianna's flowchart and add your corrections, could it be the right representation?

Schermata 2019-10-29 alle 21 02 25