Exemplo n.º 1
0
 // добавление нового элемента
 public void Add(string key, string inf)
 {
     if (count == 0)
         head = new MyNode(key, inf, head, head);
     else
     {
         MyNode p = TryToFindSameKey(key);
         if (p == null)
         {
             MyNode tmp = new MyNode(key, inf, head, head.prev);
             head = tmp;
         }
         else
             p.inf = inf;
     }
     count++;
     isEmpty = false;
 }
Exemplo n.º 2
0
 // Конструктор
 public MyList()
 {
     head = null;
     count = 0;
     isEmpty = true;
 }
Exemplo n.º 3
0
 public MyNode(string key, string inf, MyNode next, MyNode prev)
 {
     this.key = key;
     this.inf = inf;
     this.next = next;
     this.prev = prev;
 }