Given the pseudo-code for a recursive function foobar, answer the following questions.
foobar(A, k):
# A is a list of n integers and k is a small positive integer. # Assume n = ka (int d > 0).
let u = n/k
if u == 1:
print "Reached base case."
else:
for i = 1, 2, ..., n:
print the i-th element of A
divide A into k sublists, A1, A2, ..., Ak, each with u integers
for i = 1, 2, ..., k:
foobar(Ai, k)
1) (4 marks) Write its running time T(n) in a recurrence relation.
2) (8 marks) Derive a closed form formula for T(n). Show detailed intermediate steps
3) (3 marks) Write and explain its computational complexity using the O-notation.