I need to return the size of a doubly linked list and I am having trouble thinking of the logic to go about doing this.

template <class T>

int List<T>::size() const

Returns the current size of the list; i.e., the number of data items currently stored in the list. Since the size has not been stored as a data member, you will need to traverse the list and count the number of nodes, and then return that count.

Anything to get me started on this would be great.

Thank You