CS209 lab6
http://www.maths.nuigalway.ie/~gettrick/teach/cs209/l6.html
-
For this lab you should submit all source code (C
files), and the result(s) of running the program on (a few)
test cases.
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).
-
The above material should be uploaded via BLACKBOARD
before
the deadline of 5pm
Wednesday 9th. March 2011. 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. Please see
http://www.nuigalway.ie/engineering/documents/plagiarism_guide_students
_v4.pdf. You risk getting zero for your lab if it is found to be
plagiarized.
http://www.maths.nuigalway.ie/~gettrick/teach/cs209/progs/
This lab is based on using structures and pointers in C to
do manipulations on linked lists.
The starting point for the lab is the program strc.c at
http://www.maths.nuigalway.ie/~gettrick/teach/cs209/progs/strc.c: You should spend at least 30 minutes studying this program (& of course run it).
-
Add a new function
insertN(struct list *x, int num, int pos, int n)
that will insert n copies of the integer
num at position pos, if that is possible
(if pos is too big, take appropriate action).
-
Modify the search function so that it prints out all
positions where the data item is found.
©
NUI, Galway