0 votes 0 votes SeemaTanwar asked Oct 5, 2018 SeemaTanwar 247 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply arvin commented Oct 5, 2018 reply Follow Share nlogn 0 votes 0 votes eyeamgj commented Oct 5, 2018 reply Follow Share sort linked list 1 using merge sort................................O(nlogn) sort linked list 2 O(nlogn) now suppose an instance after sorting list1 10,20,30,40 list2 5,15,20,40 start from list 1 take 10 compare it with 5 ..........skip the smalker one so skip 5 compare 10 with 15 skip 10 .....so go 20 of list 1 compare 20 with 15 skip 15 of list 2 now we are at 20 of list 2 compare 20 of list 1 with 20 of list 2 pick 20 as common find similary come to 30 of list one and 40 of list 2 .. and perform rest cases.............. here total O(m+n) in w.c given m=nso O(n) overall=O(nlogn)+O(nlogn)+O(n) so O(nlogn) 0 votes 0 votes Please log in or register to add a comment.