title: Given a linked list of numbers. Swap every 2 adjacent links
body: <p>Given a linked list of numbers. Swap every 2 adjacent links. For example, if a linked list given to you is:</p>
  
  <pre><code>a-&gt;b-&gt;c-&gt;d-&gt;e-&gt;f 
  </code></pre>
  
  <p>Output expected: </p>
  
  <pre><code>b-&gt;a-&gt;d-&gt;c-&gt;f-&gt;e
  </code></pre>
  
  <p>Every 2 alternate links have to be swapped. </p>
  
  <p>I have written a solution here. Can you suggest me some other solution. Can you comment on my solution and help me better write it?</p>
  
  <pre><code>void SwapAdjacentNodes (Node head)
  {
      if (head == null) return; 
  
      if (head.next == null) return; 
      Node curr = head;
      Node next = curr.Next;
      Node temp = next.Next;
  
      while (true)
      {
          temp = next.Next;
          next.Next = curr;
          curr.Next = temp;
  
          if  (curr.Next != null)
              curr = curr.Next;
          else
              break;
          if (curr.Next.Next!=null)
              next = curr.Next.Next;
          else
              break;
      }   
  }
  </code></pre>