Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
remove duplicates
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using COLG = System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Node { public int data; public Node next; public Node (int value, Node nextNode) { data = value; next = nextNode; } } public class Program { public Node RemoveDuplicates (Node head) { COLG.List<Node> knownNodes = new COLG.List<Node>(); Node focus = head; while (focus != null) { if (knownNodes.Exists(x => x.data == focus.data)) { knownNodes.Add(focus); } else { } } } public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
recur 4
C# constructor in inheritance
UUEncode, UUDecode, XXEncode or XXDecode a string.
HelloWorld
prettier Tasty
Hello-Heath-World
double to hex to double lose precision
My Wall
a.out
Operators
Please log in to post a comment.