private Numbered<T> getKValue(int k, Node<T> node)
    {
        if (node == null) {
            return new Numbered<T>(k, null);
        }
        int num = 0;
        if (node.left != null) {
            Numbered<T> val = getKValue(k, node.left);
            if (val.num == k) {
                return val;
            }
            num = val.num;
        }
        if (num + 1 == k) {
            return new Numbered<T>(k, node.data);
        }
        num++;
        if (node.right != null) {
            Numbered<T> val = getKValue(k - num, node.right);
            if (val.num == k - num) {
                return new Numbered<T>(k, val.data);
            }
            num += val.num;
        }
        return new Numbered<T>(num, null);
    }