Beispiel #1
0
 public List()
 {
     head = new ListElement();
     head.SetNum(0);
     head.SetNext(null);
     length = 0;
 }
Beispiel #2
0
 public List()
 {
     head = new ListElement();
     head.num = 0;
     head.next = null;
     length = 0;
 }
Beispiel #3
0
 public void Insert(int value, ListElement pos)
 {
     ListElement temp = new ListElement();
     temp.num = value;
     temp.next = pos.next;
     pos.next = temp;
     ++length;
 }
Beispiel #4
0
 public virtual void Insert(int value, ListElement pos)
 {
     ListElement temp = new ListElement();
     temp.SetNum(value);
     temp.SetNext(pos.GetNext());
     pos.SetNext(temp);
     ++length;
 }
Beispiel #5
0
 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;
 }
Beispiel #6
0
 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;
 }
Beispiel #7
0
 public int Retrieve(ListElement pos)
 {
     return pos.num;
 }
Beispiel #8
0
 public ListElement Next(ListElement pos)
 {
     return pos.next;
 }
Beispiel #9
0
 public ListElement Next(ListElement pos)
 {
     return pos.GetNext();
 }
Beispiel #10
0
 public int Retrieve(ListElement pos)
 {
     return pos.GetNum();
 }
Beispiel #11
0
 public ListElement Next(ListElement pos)
 {
     return(pos.next);
 }
Beispiel #12
0
 public int Retrieve(ListElement pos)
 {
     return(pos.num);
 }
Beispiel #13
0
 public ListElement Next(ListElement pos)
 {
     return(pos.GetNext());
 }
Beispiel #14
0
 public int Retrieve(ListElement pos)
 {
     return(pos.GetNum());
 }
 public void SetNext(ListElement value)
 {
     this.next = value;
 }