Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian W. Kernighan

Intersection of two Sorted Lists

Language Java | Level Intermediate | Category Data structure | September 5, 2015 10:50 pm


Data structure Description

Write a program to find intersection nodes from two linked lists. The utility function takes two linked list head nodes and returns the intersection linked list head. The display function iterate all the nodes from intersection linked list and display.


Output

   					 

Items from the first list: [1, 1, 1, 4]
Items from the Second list: [1, 1, 1, 4]
Intersection Items: [1, 4]

				    

Comments


No comments available!

Please login to add comments.