def array_multiply(a):
if len(a) == 2:
return mul(a[0], a[1])
else:
return mul(array_multiply(a[0:len(a)/2], a[len(a)/2:len(a)]
Is that what you guys did? He said the algorithm was simple and to me this seems to work. I’m having a tough time with the tree though:
r = 8, l = 4
285405120 | O(14^a)
8712 32760 | O(7^a) + O(8^a)
72 121 156 210 | 4 O(8^a)
8 9 10 11 12 13 14 15 |
I can’t seem to get the time complexity to work, unless my exponent algebra is wonky.
I’m going to keep working on it, but I’m about to get on a flight back to NY, so I won’t have Internet until 12:30...