Write a function to concatenate two linked lists. Given lists l1
= (2, 3, 1) and l2 = (4, 5),
after return from concatenate(l1,l2) the list l1 should be changed
to be l1 = (2, 3, 1, 4, 5). Your
function should not change l2 and should not directly link nodes
from l1 to l2 (i.e. the nodes
inserted into l1 should be copies of the nodes from l2.)
Q3. Modify your code in Q2 so that if l1 and l2 are sorted, the
resultant concatenated list must
also be sorted.
do in c++ plz attempt all
Write a function to concatenate two linked lists. Given lists l1 = (2, 3, 1) and l2 = (4, 5), after return from concaten
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am