請計算下列C語言程式片斷或函數的頻率計數:
(1) for ( i = 0; i < n; i++ ) for ( j = 0; j < n; j++ ) for ( k = 0; k < n; k++) a = a + 1; | 頻率計數 : 2n3+2n2+2n+1 |
(2) i = 1; while ( i <= n ) { a = a + 1; i++; } | 頻率計數 : 3n+2 |
評分: ★★★☆
回覆刪除次方請作上標