Stories. Questions. Different perspectives.
Browse WAURE
← Advice & Questions
Education · Advice & Questions ·

Does correct output meet a programming assignment that specifically asks for recursion?

Education category photographEducation

My program gives the expected output for the examples in our introductory computing assignment. I wrote it with a loop because that was the method I could explain clearly. Reading the brief again, I noticed it explicitly asks for a recursive solution.

The automatic checker shows a pass for the examples, which makes me reluctant to disturb working code. But I have not demonstrated the technique the task names. CS50's lecture notes distinguish a recursive function, which calls itself, from an iterative approach.

What is a sensible next step before submission? I want to use the working version to help me learn the requested method, without copying a replacement I do not understand or assuming that a passing output check settles the marking.

Discussion

5 community replies

Treat the explicit method requirement as part of the task. A checker accepting example outputs does not tell you that every assessment criterion has been met. Check the rubric and ask the tutor about the mismatch while there is time to address it.

Keep your loop version as a reference you can explain. On paper, identify what smaller instance of the problem a recursive call would handle and what situation would stop further calls. That is a learning step before rewriting the code.

Use only the help your course permits. You can ask about a concept or a small analogous exercise without requesting a finished answer to the assessed task. Be clear about the point where you lose track of the calls.

If the deadline is close, ask what help or submission options are available rather than renaming the function and claiming the requirement is met. The correct output is useful progress, even if it is not the whole requested solution.

Yes, and keep any explanation of the submitted method accurate. If you still cannot complete the required version, follow the tutor's guidance about submitting your actual progress. Do not infer a guaranteed mark, extension or exemption from an output checker or a support request.

Join the discussion

More in Education