subject

Setting up the initial values for the min and max depends on whether n is odd or even. If n is even, compare the first two elements and assign the larger to max and the smaller to min. Then process the rest of the elements in pairs. If n is odd, set both min and max to the first element. Then process the rest of the elements in pairs. A) Write the above description in algorithmic form. Follow this notation:
MINIMUM(A)
1 min = A1
2 for = 2 to A. length
3 If min > A[i]
4 min- A
5 return min
B) Show that your algorithm need at most 3*n/2.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
You know the right answer?
Setting up the initial values for the min and max depends on whether n is odd or even. If n is even,...
Questions
question
Mathematics, 09.01.2020 05:31
question
Social Studies, 09.01.2020 05:31
question
Mathematics, 09.01.2020 05:31
question
Mathematics, 09.01.2020 05:31