Answer:
Running time of algorithm is O(n).
Step-by-step explanation:
n is power of 2
n =2,4,8,16,32,...................................
A is an array having n elements
B is an array of size 0 to (n/2)-1
if n=4 B then (4/2)-1 =1 So B has size 2
for(i=0;i<=(n/2)-1;++)
{
B[i]=A[2i]+A[2i+1];
}
This for loop will run n/2 times so complexity in terms of Big Oh is O(n/2) =O(n)
Running time of algorithm is O(n).