Пример #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;
 }