public Node Convert(Node pRootOfTree){if(pRootOfTree == null){return null;}convertChild(pRootOfTree);
Node head = pRootOfTree;
while (head.left != null){
head = head.left;}return head;}
Node prev = null;
public void convertChild(Node root){if(root == null){return;}convertChild(root.left);
root.left = prev;if(prev != null){
prev.right = root;}
prev = root;convertChild(root.right);}
//打印单链表
public void display(Node head){
Node cur = head;
while (cur != null){
System.out.print(cur.val +" ");
cur = cur.right;}
System.out.println();}}