public List() { head = new ListElement(); head.SetNum(0); head.SetNext(null); length = 0; }
public List() { head = new ListElement(); head.num = 0; head.next = null; length = 0; }
public void Insert(int value, ListElement pos) { ListElement temp = new ListElement(); temp.num = value; temp.next = pos.next; pos.next = temp; ++length; }
public virtual void Insert(int value, ListElement pos) { ListElement temp = new ListElement(); temp.SetNum(value); temp.SetNext(pos.GetNext()); pos.SetNext(temp); ++length; }
public void Remove(ListElement pos) { ListElement temp = this.head; if (this.head.next == null) return; while (temp.next == null || temp.next != pos) { temp = temp.next; } temp.next = pos.next; --length; }
public void Remove(ListElement pos) { ListElement temp = this.head; if (this.head.GetNext() == null) return; while (temp.GetNext() == null || temp.GetNext() != pos) { temp = temp.GetNext(); } temp.SetNext(pos.GetNext()); --length; }
public int Retrieve(ListElement pos) { return pos.num; }
public ListElement Next(ListElement pos) { return pos.next; }
public ListElement Next(ListElement pos) { return pos.GetNext(); }
public int Retrieve(ListElement pos) { return pos.GetNum(); }
public ListElement Next(ListElement pos) { return(pos.next); }
public int Retrieve(ListElement pos) { return(pos.num); }
public ListElement Next(ListElement pos) { return(pos.GetNext()); }
public int Retrieve(ListElement pos) { return(pos.GetNum()); }
public void SetNext(ListElement value) { this.next = value; }