using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
Console.WriteLine("Original List:");
Console.WriteLine("Removing duplicates...");
list.RemoveDuplicatesApproach1();
Console.WriteLine("List without duplicate nodes:");
private Node next = null;
internal void ShowNodes()
Console.WriteLine("No more nodes to display.");
Console.WriteLine("Node : " + current.Data);
internal void ShowLength()
string numString = "numbers";
Console.WriteLine(String.Format("List has [{0}] {1}.", _length.ToString(), numString));
Node newNode = new Node(d);
while (current.Next != null)
internal void RemoveDuplicatesApproach1()
if (b.Next != null && a.Data == b.Next.Data)
internal void RemoveDuplicatesApproach2()
if (a.Data == b.Next.Data)
internal bool Find(int d)
while (current.Next != null && current.Data != d)