private static Node search(Node r, int v) {
		Node curr = r;
		while (curr != null) {
			if (curr.v == v) {
				return curr;
			} else if (curr.v < v) {
				curr = curr.right;
			} else {
				curr = curr.left;
			}
		}
		return null;
	}