Complete the Size() function
The Size()
function should return the number of elements in the list, not including the dummy node.
Follow these steps:
-
Edit List.cpp. You will edit
List::Size()
near the bottom of the file. - Write a while loop that traverses the linked list with a current pointer, like in other functions. Keep track of how many nodes have been visited with a counter, then return that counter.