Example #1
0
 private void pop_front()
 {
     if (!this.empty())
     {
         this.first = this.first.next;
         length--;
     }
 }
Example #2
0
 private void pop_back()
 {
     if (!this.empty())
     {
         this.last      = this.last.prev;
         this.last.next = null;
         length--;
     }
 }
Example #3
0
 public T this[int indeks] {
     get {
         wezel <T> W = this.first;
         for (int i = 0; i < indeks; i++)
         {
             W = W.next;
         }
         return(W.val);
     }
 }
Example #4
0
        private void push_front(T x)
        {
            wezel <T> w = new wezel <T> (x);

            if (this.empty())
            {
                this.first = w;
                this.last  = w;
                this.length++;
            }
            else
            {
                w.next          = this.first;
                this.first.prev = w;
                this.first      = w;
                this.length++;
            }
        }
Example #5
0
 public void Reset()
 {
     current = pocz;
 }
Example #6
0
 public bool MoveNext()
 {
     current = current.next;
     return(current != null);
 }
Example #7
0
 public ListEnum(wezel <T> W)
 {
     this.pocz      = new wezel <T>(default(T));
     this.pocz.next = W;
     this.current   = this.pocz;
 }