-
Notifications
You must be signed in to change notification settings - Fork 8
Lecture "Algorithms", exercise 2 #5
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
Comments
Hi all, Thanks for your answers. Please remember that, even if the flowcharts are an informal way to describe an algorithm, if the computational problem in input says that one should return "yes" or "no", then that is what it is expected. In particular, returning numbers, for instance, is not the right way of implementing the algorithm – even if it is pretty clear to me what the numbers actually stand for. Another issue that I saw is that some of you have used explicitly names of different objects in body of the algorithm (e.g. marker vs. pen). This should be avoided in the definition of the algorithm, since it seems that the only possibility that such algorithm has is to take in input a marker and a pen, while it is supposed to work with any input object – e.g. what if I want to run it using two pens, or an apple and an orange? Finally, if you initialise something (e.g. "initialise result = 0"), then one should use it somehow (e.g. by returning the result value). See the example in the lecture notes for clarification on this passage. |
Write the flowchart of an algorithm that takes in input two objects and returns “yes” whether the two objects are the same, otherwise it returns “no”.
The text was updated successfully, but these errors were encountered: