program Linked List: modify the following program to make a node containing data values of int, char, and string. #include using namespace std; struct node { int data; struct Node *next; }; struct...



program Linked List:


modify the following program to make a node containing data values of int, char, and string.


#include


using namespace std;


struct node


{


int data;


struct Node *next;


};


struct Node* head = nullptr;//or Null or 0;


void insert(int new_data)


{


struct Node* new_node=(struct Node*) new(struct Node);


new_mode->data=new_data;


new_mode->next=head;


head=new_node;


}


void display()


{


struct Node* ptr;


ptr=head;


while(ptr ! = NULL)


{


  coutdata<>


ptr=ptr->next;


}


}


int main()


{


insert{2};


display{};


return0;


}



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here