public void addNode(Node node) { Node Nodx = this; while (Nodx.nextNode != null) { Nodx = Nodx.nextNode; } Nodx.nextNode = node; node.PreviousNode = Nodx; }
public void addNode(Node Nodx) { Node Nod = this.Tail; while (Nod.nextNode != null) { Nod = Nod.nextNode; } this.Head = Nodx; Nod.nextNode = Nodx; Nodx.PreviousNode = Nod; }
public List(Node Nod) { this.Tail = Nod; this.Head = Nod; }
public void addNodeBackwardsAt(Node Nodx, int ID) { Node Nod = this.Head; Node Nad = new Node(""); Node Ned = new Node(""); for (int i = 0; i >= ID; i++) { if (i == ID) { Nodx.PreviousNode = Nad; } else if (i == ID - 1) { Nad = Nod.PreviousNode; Nod.PreviousNode = Nodx; Nodx.nextNode = Nod; Nad.nextNode = Nodx; } else if (i == ID + 1) { Nod.nextNode = Nodx; } else { Nod = Nod.PreviousNode; } } }
public static decimal XCompare(String Str1, String Str2, int spawn) { List x = new List(new Node("")); for (int i = 0; i < Str1.Length/spawn; i++) { x.addNode(new Node(Str1.Substring(spawn * i, spawn))); } int r = 0; Node f = x.Tail; Node g = new Node(new Node("")); for(int i = 0 ; i < spawn ; i++) { if (Str2.Contains(f.nodeValue.ToString())) { r++; } f = f.nextNode; } decimal amount = (decimal)r / (decimal)Str1.Length; return amount; }// End XCompare