title: Recursion on linkedlist : how to compare?
body: <p>I'm currently working on recursion in linked list and I have a question where I have to compare two numbers in a linked list and I have to do it recursively.</p>
  <p>It return true if all the elements on the list are in an ascending order.</p>
  <p>Here what I've done in my List :</p>
  <pre><code>public boolean ascending() {
          if(this.first == null) return false;
          return this.first.ascending();
      }
  </code></pre>
  <p>Here what I've done in my Cells :</p>
  <pre><code>public boolean ascending() {
          if(this.next != null) {
              if(this.employee.getNumbers() &lt; this.next.employee.getNumbers()) return true;
              this.next.ascending();
          } return false;
      }
  </code></pre>
  <p>The problem is that my code return true for 100 &lt; 200 but false for 100 &lt; 200 &lt; 300 and true for 100 &lt; 200 &lt; 100.</p>
  <p>Any suggestion? Thank you in advance!</p>