@@ -0,0 +1,1135 @@
+package cc150.chpt12;%0A%0A/**%0A * 12.2 Write code to remove duplicates from an unsorted linked list.%0A * FOLLOW UPS & COMPLICATIONS%0A * How would you solve this problem if a temporary buffer is not allowed?pg 42%0A * Created by zhengxiao on 7/17/14.%0A */%0Apublic class Q2S2 %7B%0A    public static void main(String%5B%5D args) %7B%0A        Node node = new Node(%22a%22, new Node(%22b%22, new Node(%22a%22, null)));%0A        delDups(node);%0A        System.out.println(node);%0A    %7D%0A%0A    private static void delDups(Node node) %7B%0A        Node n = node;%0A        while (n != null) %7B%0A            Node r = n;%0A            while (r != null) %7B%0A                if (r.data != null && r.data.equals(n.data)) %7B%0A                    // found dup, remove r%0A                    if (r.next != null) %7B%0A                        Node next = r.next;%0A                        r.data = next.data;%0A                        r.next = next.next;%0A                    %7D else %7B%0A                        r.data = null;%0A                        r = r.next;%0A                    %7D%0A                %7D else %7B%0A                    r = r.next;%0A                %7D%0A            %7D%0A            n = n.next;%0A        %7D%0A    %7D%0A%7D%0A

complete half of chpt12