Time complexity of a recursive algorithm

前端 未结 5 2143
礼貌的吻别
礼貌的吻别 2020-11-29 01:19

How can I calculate the time complexity of a recursive algorithm?

int pow1(int x,int n) {
    if(n==0){
        return 1;
    }
    else{
        return x *          


        
5条回答
  •  庸人自扰
    2020-11-29 02:25

    It can be a bit complex, but I think the usual way is to use Master's theorem.

提交回复
热议问题