void reverse(IntNodePtr head){ Stack stack(getSizelinkedList(head)); IntNodePtr temp = head; while(NULL != temp){ stack.push(temp->getData()); temp = temp->getLink(); } temp = head; while(NULL != temp){ temp->setData(Stack.pop()); temp = temp->getLink(); } } int getSizelinkedList(IntNodePtr head){ IntNodePtr temp = head; int counter = 0; while(NULL != temp){ temp = temp->getlink(); counter++; } return counter; }