Write a function to concatenate two linked lists. Given lists l1 = (2, 3, 1) and l2 = (4, 5), after return from concaten

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a function to concatenate two linked lists. Given lists l1 = (2, 3, 1) and l2 = (4, 5), after return from concaten

Post by answerhappygod »

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply