public void connect(TreeLinkNode root) {
		LinkedList<TreeLinkNode> queue = new LinkedList<TreeLinkNode>();
		if (root != null) {
			queue.add(root);
			queue.addLast(null);
			TreeLinkNode prev = null;
			while (!queue.isEmpty()) {
				TreeLinkNode current = queue.removeFirst();
				if (prev != null && current != null) {
					prev.next = current;
				}
				prev = current;
				if (current == null) {
					if (queue.isEmpty()) {
						break;
					} else {
						queue.addLast(null);
					}
				} else {
					if (current.left != null) {
						queue.addLast(current.left);
					}
					if (current.right != null) {
						queue.addLast(current.right);
					}
				}
			}
		}
	}