I spoke about this issue with my proffesor and she said that the purpose of this is to make a "loop"to look for the number. Basically, it's to create a new function(simple one) to search for the number input by the user.
Say:
If you have a list with the following numbers:
List: 32 53 675 23 7 96 2 890 2
|
with , of course, random numbers, each number has a slot numbered 1st 2nd 3rd 4th ,, etc and the objective is to ask the user which number he/she wasn't to see, and then delete it.
Say, the user wants to she the 3rd number from the list shown above, then the user will request to see "675".
That's all she wanted us to do on this code. She said to complete it by the end of next week, but now,I'm stuck on how to make a loop with pointers in a link list. That is, the loop, can pull the number I want to see(with me being the user for testing purposes) out of the list with random numbers.
something like this is what she wants.
enter a list of numbers,press enter to continue to the next input, and enter -999 to finish the list:
43
54
665
86
324
85
34
862
-999
list:43 54 665 86 324 85 34 862
What occurrence(s) would you like to delete:665
The list has been updated.
Updated list: 43 54 86 324 85 34 862
The list after deleting the smallest element:
list: 42 54 86 324 85 862
Which occurrence would you like see:
(Enter the location you would like to see not the actual number on the list(e.g. 1 ,2 ,3 , 4, 5 etc)
3
Number your requested is: 86
Number located on the 3 slot in the list.
press any key or enter to continue..........
|