InterviewSolution
| 1. |
How To Remove Duplicate Nodes In An Unsorted Linked List? |
|
Answer» This problem is similar earlier problems related to String and arrays i.e. removing duplicate elements in an array (see) or removing duplicate CHARACTERS from given String (see here). You NEED to write a program to remove all duplicate nodes from an unsorted linked LIST in JAVA. For example if the linked list is 22->21->22->31->41->23->21 then your program should convert the list to 22->21->31->41->23. This question is also given in the famous Cracking the CODING Interview book so you can look at their solution as well. This problem is similar earlier problems related to String and arrays i.e. removing duplicate elements in an array (see) or removing duplicate characters from given String (see here). You need to write a program to remove all duplicate nodes from an unsorted linked list in Java. For example if the linked list is 22->21->22->31->41->23->21 then your program should convert the list to 22->21->31->41->23. This question is also given in the famous Cracking the Coding Interview book so you can look at their solution as well. |
|