The problem is not clear to me. How can an algo exist that takes O(n)
space but only O(log n) time? Even just to access the O(n) memory, we
need O(n) time. For example in the above algo, if i = 1 and j = n, then
how can the sum be obtained in O(log n) time?

Reply via email to