This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
notes:fall2024:projects:msi3 [2024/10/03 01:37] – [obtain() function] jmerri10 | notes:fall2024:projects:msi3 [2024/10/03 01:38] (current) – [clearlist() function] jmerri10 | ||
---|---|---|---|
Line 40: | Line 40: | ||
For the most part, the obtain() function should be the same as the obtain() function in msi2. Loop through your list until you find the node you would like to obtain, then return the list. | For the most part, the obtain() function should be the same as the obtain() function in msi2. Loop through your list until you find the node you would like to obtain, then return the list. | ||
=====clearlist() function===== | =====clearlist() function===== | ||
+ | The clearlist() function should be the same as in msi2, as well. Loop through your list and remove each node in the list using your rmnode() function until the list reaches NULL (end of list). Make sure the list's start and end is NULL, then return the list. | ||
=====rmlist() function===== | =====rmlist() function===== | ||
The rmlist function will call clearlist() function. After the list is successfully cleared, then the list itself will be deallocated from memory. | The rmlist function will call clearlist() function. After the list is successfully cleared, then the list itself will be deallocated from memory. |