This lab will be devoted to preparing for the prac exam. There are no marks allocated for this lab.
Here are a few sample questions:
void shift_right(int* array, int n)
which shifts every single element of the array one position to the right, with the rightmost element being wrapped around to the leftmost position. For example, if values initially contains the integers [1, 2, 3, 4, 5], once the code has executed it would contain [5, 1, 2, 3, 4].
void sanitize(char *s)
that removes duplicate characters from the string. For example, given a string "crazyfortruffle" the returned string should be "crazyfotule".
char * twentify(char s[])
that give a string will replace all spaces with '%20'.
For the following two tasks you can use these stub files
Lnode *backToFront (Lnode * head)
that given a list of nodes takes the node at the end of the list and moves it to the front of the list by changing pointers, leaving the relative order of the other nodes unchanged. This function must not create new nodes or change the value field of existing nodes.
Lnode *removeDuplicates (Lnode *head)
that will delete any duplicates from the linked list.
string.h
or ctype.h
for that question.
If it is not mentioned, you may assume it is ok to use them.