예제 #1
0
        public void addNode(Node node)
        {
            Node Nodx = this;
            while (Nodx.nextNode != null)
            {
                Nodx = Nodx.nextNode;
            }
            Nodx.nextNode = node;
            node.PreviousNode = Nodx;

        }
예제 #2
0
 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;
 }
예제 #3
0
 public List(Node Nod)
 {
     this.Tail = Nod;
     this.Head = Nod;
 }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 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