subject

Assume n %2 ==0 and array A is previously declared and initialized properly with integer values. Also, array indexes range from 0 to n-1. I. A[0] to A[j], for every j in range [0, n/2-1]
II. A[n-j] contains the partial sum of A[n-1] to A[n-j], for every j in range [1, n/2]
III. res contains the sum of the original values of A[n/2-1] and A[n/2]
IV. res contains the sum of all numbers in A
V. The algorithm runs in O(n):

For j= 1 to n/2=1
A[j]= A[j] + A[j-1]
For j=2 n/2
A[n-j]= A[n-j] + A[n-j+1]
res= A[n/2 -1] + A[n/2]

a. III and V only
b. I, II, IV and V only
c. l, Il, IV only
d. l, Il, III only
e. l, II, III, V only

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
question
Computers and Technology, 24.06.2019 09:50
Create a string list. 2. use console.readline() to collect values of firstname, lastname, street, city, state, zip, save them to list. 3. write a simple linq statement, call method uppercasewords() to change first letter to uppercase. 4. create a foreach statment to display the information. public static string uppercasewords(string value) { char[] array = value.tochararray(); if (array.length > = 1) { if (char.islower(array[0])) { array[0] = char.toupper(array[0]); } } for (int i = 1; i < array.length; i++) { if (array[i - 1] == ' ') { if (char.islower(array[i])) { array[i] = char.toupper(array[i]); } } } return new string(array);
Answers: 3
You know the right answer?
Assume n %2 ==0 and array A is previously declared and initialized properly with integer values. Als...
Questions
question
Mathematics, 05.08.2019 12:10
question
History, 05.08.2019 13:10
question
Mathematics, 05.08.2019 13:10
question
Mathematics, 05.08.2019 13:10
Questions on the website: 13722359