C ++ data structures and algorithms fourth edition homework problems

3.10
13. The one-way linked list to the end of another one-way linked list.

void List_addlist(List la, List lb) {
 List pa, pb;
 pa = la->next;
 pb = lb->next;
 int n;
 n = List_length(la);
 for (int i = 1; i < n; i++)
 {
  pa = pa->next;
 }
 pa->next = pb;
}

Guess you like

Origin blog.csdn.net/qq_33551749/article/details/89855922