+ 1
Write a program to concatenate two linked lists into one? node*concatenate(node*head1, node*head2)
Data structure question
3 odpowiedzi
+ 3
first off, you should learn how to indent your code properly. i don't know if your teacher teached you about this but indentation is crucial for code readability.
other than that the code is already correct. i don't know why you asked in the first place if your code already works
+ 3
"lvl 1 crook" tnx for you comment next time i will improve my self tnx a lot!
+ 2
C-programming
node*concatenate(node*head1,node*head2)
{
node*p;
if
(head1==NULL)
return
(head2);
if
(head2==NULL)
return
(head1);
p=head1;
while(p->next !=NULL)
p=p->next;
p->next = head2;
return
(head1);
} //if it is correct upvote me,if not give a comment how can i write the program