Exemplo n.º 1
0
        public int Noded(List list, int left, int right)
        {
            Node pivot       = Head;
            Node LeftAnchor  = FindItem(left);
            Node RightAnchor = FindItem(left);

            while (true)
            {
                while (LeftAnchor._intvalor < pivot._intvalor)
                {
                    left++;
                    LeftAnchor = FindItem(left);
                }
                while (RightAnchor._intvalor > pivot._intvalor)
                {
                    right++;
                    RightAnchor = FindItem(right);
                }

                if (left < right)
                {
                    Node Copy = RightAnchor.ShallowCopy();
                    RightAnchor = LeftAnchor;
                    LeftAnchor  = Copy;
                }
                else
                {
                    return(right);
                }
            }
        }
Exemplo n.º 2
0
 public void ChangeBetween(int Position, int Position2)
 {
     Node Node1 = new Node();
     Node Node2 = new Node();
     Node Copy2 = new Node();
     Node1 = FindSingular(Position);
     Node2 = FindSingular(Position2);
     Copy2 = Node2.ShallowCopy();
     Node2.valor = Node1.valor;
     Node1.valor = Copy2.valor;
 }
Exemplo n.º 3
0
        public void ChangeBetween(int Position, int Position2)
        {
            Node Node1 = new Node();
            Node Node2 = new Node();
            Node Copy2 = new Node();

            Node1       = FindSingular(Position);
            Node2       = FindSingular(Position2);
            Copy2       = Node2.ShallowCopy();
            Node2.valor = Node1.valor;
            Node1.valor = Copy2.valor;
        }