This challenge is part of a tutorial track by MyCodeSchool and is accompanied by a video lesson.
You are given the pointer to the head node of a linked list and you need to print all its elements in reverse order from tail to head, one element per line. The head pointer may be null meaning that the list is empty - in that case, do not print anything!
You have to complete the void ReversePrint(Node* head) method which takes one argument - the head of the linked list. You should NOT read any input from stdin/console.
Print the elements of the linked list in reverse order to stdout/console (using printf or cout) , one per line.
1 --> 2 --> NULL
2 --> 1 --> 4 --> 5 --> NULL
1. First list is printed from tail to head hence 2,1
2. Similarly second list is also printed from tail to head.