retagged by
474 views
0 votes
0 votes
int sum(int A[], int n)

{

            int sum = 0, i;

            for(i = 0; i< n; i++)

            sum = sum + A[i];

            return sum;

}

What is the space complexity?


Select one:
a. 2n + 8
b. 2n + 16
c. n^2
d. n + 8

What is the space complexity?

retagged by

Please log in or register to answer this question.

Related questions

3 votes
3 votes
1 answer
2
Asim Abbas asked Jan 12, 2018
968 views
I am having a doubt in this question. The binary search algorithm is implemented using recursion. Then the space complexity is :-(1) O( 1 )(2) O( n )(3) O( logn )(4) O(n ...
1 votes
1 votes
1 answer
3
reena_kandari asked Feb 5, 2017
1,733 views
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
0 votes
0 votes
1 answer
4
Dknights asked Jan 2
152 views