Пример #1
0
 public void Rotate(int amount)
 {
     if (amount == 0)
     {
         return;
     }
     for (int i = 0; i < Math.Abs(amount); i++)
     {
         if (amount > 0)
         {
             Current = Current.Next;
         }
         else
         {
             Current = Current.Previous;
         }
     }
 }
Пример #2
0
 public void AddAt(T value, int stepFromCurrent)
 {
     Rotate(stepFromCurrent);
     Current = new DoubleLinkedNode <T>(Current.Previous, Current, value);
 }
Пример #3
0
 public void Add(T value)
 {
     Current = new DoubleLinkedNode <T>(Current.Previous, Current, value);
 }
Пример #4
0
 public CircularList(T val)
 {
     Head = Current = new DoubleLinkedNode <T>(val);
 }