public void connect1(TreeLinkNode root) {
		if (root == null)
			return;
		Queue<TreeLinkNode> curLev = new LinkedList<TreeLinkNode>();
		curLev.add(root);
		while (!curLev.isEmpty()) {
			Queue<TreeLinkNode> nextLev = new LinkedList<TreeLinkNode>();
			while (!curLev.isEmpty()) {
				TreeLinkNode cur = curLev.poll();
				if (cur.left != null)
					nextLev.add(cur.left);
				if (cur.right != null)
					nextLev.add(cur.right);
				if (!curLev.isEmpty()) {
					TreeLinkNode curNext = curLev.peek();
					if (curNext.left != null)
						nextLev.add(cur.left);
					if (curNext.right != null)
						nextLev.add(cur.right);
					cur.next = curNext;
				}
			}
			curLev = nextLev;
		}
	}