CS209 lab5


http://www.maths.nuigalway.ie/~gettrick/teach/cs209/l5.html




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:

  1. Modify the insert function to create a new insert function that adds to the beginning (rather than the end) of the linked list.
  2. Add a new function insertPOS(struct list *x, int num, int pos) that will insert at position pos, if that is possible (if pos is too big, take appropriate action).
  3. Modify the search function so that it prints out the position where the data item is found. (If it occurs more than once print the position of first occurence.)

© NUI, Galway