title: Merge-Sort on linked list
body: <p>Could anyone tell me the difference between these two code segments with and 
     without return statement?What will be the effect?</p>
  
  <pre><code>void mergeSort( struct Node** headRef )
  {
     if( ( *headRef == nullptr  ||  (*headRef)-&gt;link == nullptr ) ) 
     {
        return
     }
        nodePtr leftPart ;
        nodePtr rightPart ;
  
        divideList( *headRef , &amp;leftPart , &amp;rightPart ) ;
  
        mergeSort( &amp;leftPart ) ;
        mergeSort( &amp;rightPart ) ; 
  
       *headRef = sortedMerge( leftPart , rightPart ) 
  }
  
  
  void mergeSort( struct Node** headRef )
  {
     if( ( *headRef != nullptr  ||  (*headRef)-&gt;link != nullptr ) ) 
     {
        nodePtr leftPart ;
        nodePtr rightPart ;
  
        divideList( *headRef , &amp;leftPart , &amp;rightPart ) ;
  
        mergeSort( &amp;leftPart ) ;
        mergeSort( &amp;rightPart ) ; 
  
       *headRef = sortedMerge( leftPart , rightPart ) ;
     }
  }
  </code></pre>
  
  <p>In the first segment i used return statement which will return me a node when its link is null but i'm trying to figure out if the same thing can happen with the second segment as first? –</p>