Esempio n. 1
0
 public void AddToFirst(Object data)
 {
     ListNode temp = new ListNode(null, data);
     temp.Next = Head;
     Head = temp;
     count++;
 }
Esempio n. 2
0
 public void RemoveFirst()
 {
     if (this.Count > 0)
     {
         Head = Head.Next;
         count--;
     }
     else
         throw new IndexOutOfRangeException();
 }
Esempio n. 3
0
 public ListNode(ListNode next, Object data)
 {
     this.next = next;
     this.data = data;
 }
Esempio n. 4
0
 //Creating a constructor that's takes data because creating null valued list is a problem
 public LinkedList(Object data)
 {
     this.head = new ListNode(null,data);
     this.count = 1;
 }
Esempio n. 5
0
 //Creating a constructor that's takes data because creating null valued list is a problem
 public LinkedList(Object data)
 {
     this.head  = new ListNode(null, data);
     this.count = 1;
 }
Esempio n. 6
0
 public ListNode(ListNode next, Object data)
 {
     this.next = next;
     this.data = data;
 }