he following recursive function is for reversing array A[lo, hi]
以下递归函数实现数组A[lo, hi]的倒置:
What is the time complexity of reverse(A, 0, n-1), for reversing an array of length n?
调用reverse(A, 0, n-1)以倒置长度为n的数组,算法的时间复杂度为:
AΘ(n)
BΘ(nlog2(n))
CΘ(n2)
DΘ(log2(n))