public T pop_back() { if (this.empty()) { return(default(T)); } T res = this.last.val; this.last = this.last.prev; length--; return(res); }
public T pop_front() { if (this.empty()) { return(default(T)); } T res = this.first.val; this.first = this.first.next; length--; return(res); }
public 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++; } }