Output not coming correct

My output is not coming correct. Please help

This is my code:

Algorithm :

  1. Pick an element from Preorder. Increment a Preorder Index Variable (preIndex in below code) to pick next element in next recursive call.
  2. Create a new tree node tNode with the data as picked element.
  3. Find the picked element’s index in Inorder. Let the index be inIndex.
  4. Call buildTree for elements before inIndex and make the built tree as left subtree of tNode.
  5. Call buildTree for elements after inIndex and make the built tree as right subtree of tNode.
  6. return tNode.

corrected code:

private Node construct(int[] pre, int plo, int phi, int[] in, int ilo, int ihi) {
         if (plo > phi) {

            return null;

        }

        Node nn = new Node();
        nn.data = pre[plo];

        int j = 0;
        for (int i = ilo; i <= ihi; i++) {
            if (in[i] == pre[plo]) {
                j = i;
                break;
            }
        }

        nn.left = construct(pre, plo + 1, plo + j - ilo, in, ilo, j - 1);
        nn.right = construct(pre, plo + 1 + j - ilo, phi, in, j + 1, ihi);

        return nn;
 }