Incorrect output in tree construction

if(ilo>ihi)
return null;

		root=new Node();
		root.data=post[phi];
		int k=-1;
		for(int i=ilo;i<=ihi;i++)
		if(in[i]==post[phi])
		k=i;
		root.left=construct(post,plo,plo+k-1-ilo,in,ilo,k-1);
		root.right=construct(post,phi-ihi+k,phi-1,in,k+1,ihi);

		return root;

replied in the doubt where you have posted the entire code link

Thank you so much sir :slight_smile: