You are viewing a single comment's thread. Return to all comments →
Did it with simple vector in C++
void reversePrint(SinglyLinkedListNode* llist) { vector<int> arr; SinglyLinkedListNode* temp = llist; while(temp != NULL){ arr.push_back(temp->data); temp = temp->next; } for(int i = arr.size() - 1; i >= 0; i--){ cout << arr[i] << endl; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
Did it with simple vector in C++