public T kobleUt() { Node<T> venstre = hentForrige(); Node<T> hoyre = this.neste; // this.neste.settForrige(this.forrige) this.forrige = null; this.neste = null; venstre.settNeste(hoyre); hoyre.settForrige(venstre); return this.data; }
public boolean settInnMellom(Node<T> venstre, Node<T> hoyre) { if (hoyre.hentForrige() == venstre && venstre.hentNeste() == hoyre) { hoyre.settForrige(this); this.settNeste(hoyre); this.settForrige(venstre); venstre.settNeste(this); return true; } else { return false; } }