I just cant get my head around it.
Is there another way going through a singly linked list without using some kind of helper function? The header file wants me to implement:
size_t priority_queue::size() {
/* code here */
}
Now I just could create a helper function that has a node as parameter and as long as node->get_next() != 0 I recursively call the helper and add 1 to a counter.
But is there actually a way to get through a singly linked list without a helper function?
I hope I was clear enough.