Skip to content

Instantly share code, notes, and snippets.

Avatar

Jun Liu Julie728

  • University of Pittsburgh
  • Pittsburgh
View GitHub Profile
@Julie728
Julie728 / Solution.java
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?
View Solution.java
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){