subject
Computers and Technology, 07.07.2021 22:30 cmir

C language Determine the Big O running time of the following code fragment with the explanation of calculation. (Follow the way that you see in class, like what is happening in the first step, second step,..., kth step). Consider that you are calling the fun() function by passing an array and its size m.
int fun(int *array, int m)
{
int k = 0, j=0;
for(k=0; k<=m*m; k++)
j = func2(array, m);
}
int func2(int m) {
int i = 0, sum=0;
while (m>0) {
m = m/2;
sum+=array[m-1];
}
return sum;
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, keke6361
When using a public computer or network, you should always
Answers: 2
image
Computers and Technology, 22.06.2019 22:50, youngboymark123
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 23.06.2019 19:00, jaymc1932
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
image
Computers and Technology, 23.06.2019 22:30, BilliePaul95
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
Answers: 1
You know the right answer?
C language Determine the Big O running time of the following code fragment with the explanation of...

Questions in other subjects:

Konu
English, 02.04.2020 01:24