예제 #1
0
 public List()
 {
     head = new ListElement();
     head.num = 0;
     head.next = null;
     length = 0;
 }
예제 #2
0
 public void Insert(int value, ListElement pos)
 {
     ListElement temp = new ListElement();
     temp.num = value;
     temp.next = pos.next;
     pos.next = temp;
     ++length;
 }
예제 #3
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;
 }
예제 #4
0
 public int Retrieve(ListElement pos)
 {
     return pos.num;
 }
예제 #5
0
 public ListElement Next(ListElement pos)
 {
     return pos.next;
 }