Professional Documents
Culture Documents
class Node{
public:
int data;
Node* next;
};
void printList(Node* n)
while (n != NULL) {
n = n->next;
//cout<<endl;
cout<<endl;
if(head!=NULL){
reverse(head->next);
cout<<head->data<<" ";
}
int main(){
second->data = 2;
head->next = second;
second->next = third;
third->next = NULL;
printList(head);
reverse(head);