title: Singly linked list empty check
body: <p>I have created this Node class for a singly linked list:</p>
  
  <pre><code> class Node{
     int item; 
     Node next;
     Node(int v){
       item = v;
       next = null; 
     }
   }
  </code></pre>
  
  <p>￼￼￼    </p>
  
  <p>I want to make a search for the node with the highest key in a method called findmax.<strong>But i want to check if the list is empty, and if so , to return null</strong>, otherwise return the node with the highest key. This is what i have done:</p>
  
  <pre><code>Node findmax(Node h){
    if(h==null)
      return null;
    else{
    //search 
    }
  </code></pre>
  
  <p>All i want to know is if the check i make to see if the list is Empty is correct.</p>