cs102 lab5
http://www.maths.nuigalway.ie/~gettrick/teach/cs102/labs/2021labs/l5.html
-
For this lab you must submit all source code (python .PY files, or
JUPYTER .IPYNB notebooks)
and, if applicable, the result(s) of running the program on (a few)
test cases. This should be sent in via BLACKBOARD (not directly by email).
The source code must
be well presented (indenting, spaces, reasonable variable/function names,
etc.) and must include comments (as a rough guideline - aim to have nearly as
many comments as lines of code). Any questions asked should be answered by
typing the answers into the relevant box on the BLACKBOARD upload form.
-
This material should be uploaded
before
the deadline of 5pm
Saturday April 3rd., 2021. You will lose 20% for each day
(or part of day) the lab is late.
-
Plagiarism (the unattributed copying of work from other sources
(internet, fellow students,....)) will not be tolerated.
You risk getting zero for your lab if it is found to be
plagiarized.
Write a program in PYTHON that carries out linear (sequential) search
of a list L for an element x. Your program must use a
recursive function. If x is not in the list, return "not found", otherwise,
return the position of (the first occurence of) x.
The list L and x should be read in from the user - and be sure to
test your program on many examples.
©
NUI, Galway