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
Get step-by-step solutions from verified subject matter experts
