Saturday, April 14, 2012

Union and Intersection of two Linked Lists in C++



Output :-
List1 : 78  19  12  30  10
List2 : 89  19  121  30
Union List : 89  121  10  30  12  19  78
Intercestion List : 30  19

1 comment:

  1. Great post, nice code.

    I think your time for the union is wrong?

    Should it not be 0(m*n)? as the calling of IsPresent loops through m and compares against n.

    ReplyDelete