You are viewing a single comment's thread. Return to all comments →
void reversePrint(SinglyLinkedListNode* head) { SinglyLinkedListNode *temp=head; int i=0; while(temp!=NULL){ i++; temp=temp->next; } temp=head; int arr[i]; for(int k=0; k<i; k++){ arr[k]=temp->data; temp=temp->next; } for(int j=i-1; j>=0; j--){ printf("%d\n",arr[j]); } }
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 →