예제 #1
0
 public static void MergeTwoSorted()
 {
     LinkNode h1     = null;
     LinkNode h2     = null;
     LinkNode merged = MergeSorted(h1, h2);
 }
예제 #2
0
 public void AddFirst(int val)
 {
     LinkNode temp = new LinkNode(val);
     temp.Next = this.Head;
     this.Head = temp;
 }
예제 #3
0
 public LinkNode(int val)
 {
     this.Val = val;
     this.Next = null;
 }
예제 #4
0
 public SingleLinkedList()
 {
     this.Head = null;
 }
예제 #5
0
 public int GetIndexValue(int index)
 {
     LinkNode currrNode = this.GetIndexNode(index);
     return currrNode == null ? -1 : currrNode.Val;
 }