title: compare between two queue list
body: <p>I have two queue <code>list</code>s and I want to check if <code>q2</code> is reverse for <code>q1</code>.</p>
  
  <p>This is my code.</p>
  
  <pre><code>public static boolean reverse ( LinkedQueue q1, LinkedQueue q2 ) {             
      for ( int i = 0; i &lt; q1.length() ; i ++)
  
      if ( q1.serve ()  == q2.gettail().getdata() ) {
          q1.enqueue(q1.serve ());
          return true ;
      } else {
          return false;
      }
      return false;
  }
  </code></pre>
  
  <p>I just check if the head of q1 equal the tail of q2 but my problem is I want to check for all elements that they are equal and I don't know how. </p>