diff --git a/Ch 02. Linked Lists/Q2_01_Remove_Dups.cs b/Ch 02. Linked Lists/Q2_01_Remove_Dups.cs index b68d7f9..9107c98 100644 --- a/Ch 02. Linked Lists/Q2_01_Remove_Dups.cs +++ b/Ch 02. Linked Lists/Q2_01_Remove_Dups.cs @@ -24,12 +24,12 @@ private void Tap(int i) private void DeleteDupsA(LinkedListNode node) { - var table = new Dictionary(); + var table = new HashSet(); LinkedListNode previous = null; while (node != null) { - if (table.ContainsKey(node.Data)) + if (table.Contains(node.Data)) { if (previous != null) { @@ -38,7 +38,7 @@ private void DeleteDupsA(LinkedListNode node) } else { - table.Add(node.Data, true); + table.Add(node.Data); previous = node; }