+ 1

Write a program to concatenate two linked lists into one? node*concatenate(node*head1, node*head2)

Data structure question

25th Nov 2019, 5:21 AM
Yosef Girma
Yosef Girma - avatar
3 Answers
+ 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
25th Nov 2019, 8:20 AM
Shen Bapiro
Shen Bapiro - avatar
+ 3
"lvl 1 crook" tnx for you comment next time i will improve my self tnx a lot!
25th Nov 2019, 9:20 AM
Yosef Girma
Yosef Girma - avatar
+ 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
25th Nov 2019, 6:19 AM
Yosef Girma
Yosef Girma - avatar