public void InsertBack(object data) { DoubleNode temp = new DoubleNode(); temp.SetData(data); if (back == null) { front = back = temp; } else { temp.SetPrevious(back); back.SetNext(temp); back = temp; } size++; }
public void InsertFront(object data) { DoubleNode temp = new DoubleNode(); temp.SetData(data); if (front == null) { back = front = temp; } else { temp.SetNext(front); front.SetPrevious(temp); front = temp; } size++; }