COP 3223H meeting -*- Outline -*- * Friday Problems with Singly-linked Lists ** reverse ------------------------------------------ FOR YOU TO DO Using lists as in "list.h", write a function list_reverse that reverses the order of a list. // modifies: lst // effect: the order of elements in lst // is reversed from its original order extern void list_reverse(list lst); Do this: (a) iteratively, with a loop (b) recursively ------------------------------------------ ** find ------------------------------------------ FOR YOU TO DO Using lists as in "list.h", write a function list_find that returns a pointer to the first node containing a given element, or NULL if the element is not in the list // ensures: the order of elements in lst // is reversed from its original order extern list list_find(list lst, ELEM sought); Do this: (a) iteratively, with a loop (b) recursively ------------------------------------------ ** insert_after ------------------------------------------ FOR YOU TO DO Using lists as in "list.h", write a function list_insert_after that inserts a given element, what, after the first node in lst containing sought, or at the end of the list if sought is not in the list // effect: what is put into the list just after // the first occurrence of sought, if any, // or at the end if sought is not in the list extern void list_insert_after(list lst, ELEM sought, ELEM what); Do this: (a) iteratively, with a loop (b) recursively ------------------------------------------