java question confused on:

What is the order of complexity of the following method?

int functionExam1 (int list[], int size)

{

int sum=0, product=1;

for (int index=0; index<size; index++) {

sum = sum +list[index];

}

for (int index2=0; index2<size; index2++) {

product = product*list[index2];

}

System.out.println(sum, product);

}

im thinking exponential order

but not too sure expert help please.

Re: java question confused on:

I would suggest running this with a series of inputs. What happens when N is 10? 100? 1000? 100000? How many calculations do you perform each time? Graph those out, and it'll be pretty easy to understand what's going on.