Remove Duplicates from a Sorted Linked List

In this tutorial, I am going to discuss a programming question to remove duplicates from a sorted linked list.

Given a sorted linked list, write a code to remove all duplicates such that each element appears only once.

For example:

Input:

1 -> 2 -> 2 -> 3 -> 3 -> NULL

Output:

1 -> 2 -> 3 -> NULL

Find the Intersection of Two Linked Lists

In this tutorial, i am going to explain how to find the intersection of two linked lists. 

Given the heads of two singly linked lists. We have to write a code to find the intersection point of two linked lists. If no intersection point is found then return null.

You may assume there are no cycles anywhere in the entire linked structure. We have to solve this problem in O(n) time complexity and by using O(1) space.

For example:

Linked list 1:  4 -> 6 -> 2 -> 7 -> NULL

Linked list 2: 8 -> 2-> 7 -> NULL

In this example, the intersection point of two lists is at node 2.