Implement a recursive function named void printBack(DoublyLinkedNode<T>* node) for the class DoublyLinkedCircularList which will print out the elements in the list from back to front. The function is initially called with the first node in the list. You may not make use of the previous(prev) links
This is my solution where I got 2 out of a possible 3 marks:
1 2 3 4 5 6 7 8 9 10
template<class T>
void DoublyLinkedCircularList<T> :: printBack(DoublyLinkedNode<T>* node)
{
if(node->next == NULL) //Correct- 1 mark
return 0;
else
printBack(node->next); //Correct - 1 mark
cout << current-> element << " ";
}
Can anyone help me figure out where I am losing a mark?