30 下列是 scheme 的 function:

那麼執行(poly 2)的結果是多少?
(A)7
(B) 12
(C)-3
(D) 55
【Russ】評論
把前置式轉換為中置式:(cube x) = x*x*x = x^3(double x) = 2*x = 2x(five x) = 5*x = 5x(poly x) = +(-(double(cube x))(five x))1= +((double(cube x)) - (five x))1= ((double(cube x)) - (five x)) + 1= (2*(x^3)-5*x)+1x代入2:(poly 2) = (2*(2^3)-5*2)+1 = 7