[問題] 幾個程式的問題
安安,各位大大,想請問2題程式
1. What is the time complexity of T(n) defined below? Please justify your answer.
T(1) = 0
T(n) = 2T(n/2) + n n > 1.
這題應該怎麼做???
2.#define M(a,b) a*b
int main(void)
{
int i = 5, j = 6;
printf(”i*j = %d”, M(i+1, j-2*2));
return 0;
}
這題答案為什麼是7呢? 為什麼不是12呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 121.254.127.79
推
07/13 00:39, , 1F
07/13 00:39, 1F
→
07/13 00:47, , 2F
07/13 00:47, 2F
推
07/16 12:45, , 3F
07/16 12:45, 3F
→
10/20 12:21, , 4F
10/20 12:21, 4F
→
10/20 12:26, , 5F
10/20 12:26, 5F
→
10/20 12:28, , 6F
10/20 12:28, 6F
→
10/20 12:31, , 7F
10/20 12:31, 7F
CSSE 近期熱門文章
PTT數位生活區 即時熱門文章