Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lecture "Algorithms", exercise 3 #6

Open
essepuntato opened this issue Nov 14, 2018 · 15 comments
Open

Lecture "Algorithms", exercise 3 #6

essepuntato opened this issue Nov 14, 2018 · 15 comments
Labels
Exercise The exercises that are introduced in the lectures.

Comments

@essepuntato
Copy link
Contributor

The previous lecture notes, entitled “Introduction to Computational Thinking”, illustrate two different algorithms, expressed in natural language, for implementing the Fibonacci function. Create two distinct flowcharts so as to implement both of them.

@essepuntato essepuntato added the Exercise The exercises that are introduced in the lectures. label Nov 14, 2018
@MattiaSpadoni
Copy link

MattiaSpadoni commented Nov 14, 2018

I try, but I'm not so sure about something.
Ah, above the line there is the first algorith, under the line the second.

P.S. I've forgotten some "no" along the flowchart

diagram ex 3

@mangiafrangette
Copy link

mangiafrangette commented Nov 14, 2018

algorithms3a

algorithms3b

I'm not sure about the graphical representation of recursion in the second flowchart!

EDIT: added the ending terminals

@friendlynihilist
Copy link

friendlynihilist commented Nov 14, 2018

I'll come back later to add other solutions that I was thinking of.
fibonacci1 2

@friendlynihilist
Copy link

algorithms3a
algorithms3b
I'm not sure about the graphical representation of recursion in the second flowchart!

I think you need to add two ending terminals! Love you anyway. 💃

@simayguzel
Copy link

untitled diagram

@lisasiurina
Copy link

untitled diagram 1

@MilenaCorbellini
Copy link

untitled diagram
diagram 2

@EleonoraPeruch
Copy link

algorithms-exercise 3a

algorithms-exercise 3b

@delfimpandiani
Copy link

Curious to hear what you guys think of this first way, making the algorithm save f(0) and f(1) to later retrieve them:
fibonacci 2

and then a, b, c way similar to others'
fibonacci 1

@Ioanna96
Copy link

untitled diagram 2
untitled diagram 1

@andreamust
Copy link

untitled diagram 2

@SeverinJB
Copy link

SeverinJB commented Nov 15, 2018

algorithms_exercise_3a

It is necessary to define f before addressing the function. Here: Fib(int n)
algorithms_exercise_3b 1

Sidenote:
The second paragraph was difficult to understand because it is not clear what "the same function" means.

@ilsamoano
Copy link

3 issue flowchart 1
3 issue flowchart 2

@tceron
Copy link

tceron commented Nov 17, 2018

function f1

Applying recursion:
function f2

@essepuntato
Copy link
Contributor Author

Hi all,

thanks for all the proposed solutions, that look correct to a first sight. Indeed, representing the recursive step with a flowchart could be tricky, but I really liked the simplicity of the approach that have been proposed in your diagrams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Exercise The exercises that are introduced in the lectures.
Projects
None yet
Development

No branches or pull requests