DS Projects
DS Projects
Examples:
Input: a: 5->10->15, b: 2->3->20
Output: 2->3->5->10->15->20
Input: a: 1->1, b: 2->4
Output: 1->1->2->4
Example:
Input : head : 1 <-> 2 <-> 4 <-> 5
<-> 6 <-> 8 <-> 9
x = 7
Output: (6, 1), (5,2)
Example:
Input:
First linked list: 1->2->3->4->6
Second linked list be 2->4->6->8,
Output: 2->4->6.
The elements 2, 4, 6 are common in
both the list so they appear in the
intersection list.
Input:
First linked list: 1->2->3->4->5
Second linked list be 2->3->4,
Output: 2->3->4
The elements 2, 3, 4 are common in
both the list so they appear in the
intersection list.