title: How to Write isRoot() method in java
body: <p>I have created a binary search tree node class. I defined the attributes </p>
  
  <ul>
  <li>parent</li>
  <li>left</li>
  <li>right</li>
  <li>key</li>
  <li>value</li>
  </ul>
  
  <p>I want to implement a binary search tree. How do I write the <code>isRoot()</code> method?</p>
  
  <p>As far as I know,</p>
  
  <pre><code> public boolean isRoot(){
        //return true if it's the root
        //return false if it's not
   }
  </code></pre>
  
  <p><code>parent</code> has been defined in the constructor so no need to pass it as a parameter. Any ideas how to start? I know how to go down the tree, nor up. All help is appreciated :) </p>