T Naughton, CS NUIM
Back to CS211 home
Problem T5.1 Create a class that maintains a description of your favourite pet.
Problem 3.2 Below is a diagram of a linked list stored in memory. What would happen to the data structure if code to 'Insert the string "Betty" after "Boo" in the list' is executed. Answer this question by drawing diagrams describing each step (yes, like a cartoon!) and clearly explain each step. (For example, the first step is to create a temporary pointer and make it point to the same thing as the head of the list. The second step is to compare what the temporary pointer is pointing to with the string "Boo". If they are the same do.... if not do....)
Problem 5.A A computer program is required that reads positive integers, one per line, from the keyboard into a list. The user indicates that they are finished by entering any negative integer (the negative integer itself is not stored). The computer program then prints out the list of numbers, on a single line, separated with blank spaces. Write this program using classes and a linked list.
Problem 5.1 Update the solution to Problem 5.A by adding the following functionality: