title: Given two trees, return true if they are structurally identical they are made of nodes with the same values arranged in the same way
body: <pre><code>public static boolean identical(treenode&lt;Integer&gt; root1,treenode&lt;Integer&gt; root2)
      {
          boolean ans;
          for(int i=0;i&lt;root1.children.size();i++)
          for(int j=0;j&lt;root2.children.size();j++)
          {
           boolean subans=identical(root1.children.get(i),root2.children.get(j));
           ans=subans;
          }
          if(root1.data==root2.data)
          {
              ans=true;
          }/* what's wrong with the code*/
          else{
              ans=false;
          }
          return ans;
      }/* how can i improve it ? */
  </code></pre>
  
  <p>i am not able to understand why my code is not working.please tell me the solutions to fix it.</p>