Question: 14) Create a singly linked list using only two variables: head and current. Traverse through the list void addToEnd (struct node *&head, int data){ //create

14) Create a singly linked list using only two variables: head and current. Traverse through the list

void addToEnd (struct node *&head, int data){

//create node

//if head==NULL

//else

}

int main (){

node * head=NULL;

addToEnd(head,1);

addToEnd(head,2);

addToEnd(head,3);

//Traverse using current

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!