标签:
1 public static void deleteDup(Node head){ 2 Node p = head; 3 while(p!=null){ 4 Node q = p; 5 while(q.next != null){ 6 if(p.data == q.next.data){ 7 q.next = q.next.next; 8 //不能加q = q.next; 9 }else{ 10 q = q.next; 11 } 12 } 13 p = p.next; 14 } 15 }
标签:
原文地址:http://www.cnblogs.com/winner-0715/p/4891836.html