Skip to content

Instantly share code, notes, and snippets.


Jun Liu Julie728

  • University of Pittsburgh
  • Pittsburgh
View GitHub Profile
Julie728 /
Created Jun 24, 2014
CareerCup 2.1 Write code to remove duplicates from an unsorted linked list. FOLLOW UP How would you solve this problem if a temporary buffer is not allowed?
import java.util.HashSet;
public class Solution {
public static void deleteDuplicates_HashSet(Node head){
HashSet<Integer> nodeSet = new HashSet<Integer>();
Node prev = null;
while(head != null){