private void pop_front() { if (!this.empty()) { this.first = this.first.next; length--; } }
private void pop_back() { if (!this.empty()) { this.last = this.last.prev; this.last.next = null; length--; } }
public T this[int indeks] { get { wezel <T> W = this.first; for (int i = 0; i < indeks; i++) { W = W.next; } return(W.val); } }
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++; } }
public void Reset() { current = pocz; }
public bool MoveNext() { current = current.next; return(current != null); }
public ListEnum(wezel <T> W) { this.pocz = new wezel <T>(default(T)); this.pocz.next = W; this.current = this.pocz; }