public TreeNode deserialize(String data) {
        if(data.equals(""))return null;
        System.out.println(data);
        String[] a=data.split(",");
        TreeNode[] t=new TreeNode[a.length];
        for(int i=0; i<a.length; i++){
            t[i]=getNode(a[i]);
        }
        int j=1;
        for(int i=0; i<a.length &&  j<a.length-2; i++){
            if(t[i]!=null){
                t[i].left=t[j++];
                t[i].right=t[j++];
            }
        }

        return t[0];
    }
First we make TreeNode array and set set created TreeNode or null values to T array.
then we set left and right children of non-null values of T array.
src/problems/hard/SerializeAndDeserializeBT.java