describe your algorithm??

andrealoria (1120 points)
3 5 9
asked Nov 6, 2021 in HW2 by andrealoria (1,120 points)
hello guys!

in the txt file, i have to describe all the function in my program, or you need a global description?

currently, I have commented on my python program01 but i dont understand what's required for the txt file.

thanks for your help!

3 Answers

elisa.onder (1920 points)
2 4 6
answered Nov 6, 2021 by elisa.onder (1,920 points)
In the .txt file you have to describe your algorithm, this means you have to describe the logic of how you solved the homework. It is like an english translation of the code
KilianS (3590 points)
5 9 27
answered Nov 6, 2021 by KilianS (3,590 points)
just remember someone has to read your code and give you suggestions, so you want the txt file to kinda explain to that person what youre doing,so they can give you better advice!
andrealoria (1120 points)
3 5 9
commented Nov 6, 2021 by andrealoria (1,120 points)
ok, but I have already commented the python code line to line.

is it wrong?
siriasannino (3050 points)
1 2 9
commented Nov 6, 2021 by siriasannino (3,050 points)
Hi! People won't see your code, but you can add the comments to the txt file and I think that would be okay. In the txt file if you're writing pseudocode, you can't use python syntax, because pseudocode is ideally universal amongst programming languages! c:
Quellocinese (2700 points)
2 4 22
commented Nov 6, 2021 by Quellocinese (2,700 points)
edited Nov 6, 2021 by Quellocinese
the pseudocode will be sent to other students for the peer assesment. They won't read code but it's still good practice to comment it. you can either describe your functions or give a global description. The algorithm has to be clear for someone that has to understand it and to give you good advice.

here are some examples that can help you:
enricomaria.follega (710 points)
4 8 13
answered Nov 7, 2021 by enricomaria.follega (710 points)
Personally i created bullet points describing the general activity the program should perform in order to reach the final task, the return of the variable of interest.

Then, for each bullet point i went down in the details, describing the functions that the program performs for that activity, as code but in words.

     Kinda this link: that Quellocinese posted.

That is the best alternative also for readibility of the pseudo-code.

i had a look at the 3 peer assessments, all of them written word file alike.

How am i supposed to understand those codes is a mistery. Also how am i supposed to evaluate the correctness and the efficiency of that code if is written like "i created a list comprehension because is fast"...yeah so, what variables did you use? how did you created it? what was your objective? and did it work?

 in my pseudo-code i tried to answer those questions also to make a favour to who will read it, you know? to spend the least amount of time and resources as possible. i think that the guy who received mine will appreciate it. Dunno.