T(n) = T(n-1) + n = T(n-2) + n-1 + n = ... = 1+ 2 + ... + n = (n+1)n/2 = theta(n^2) 注意假设T(0) = 0(递归必须有基础) 希望这是你的意思