What does this following algorithm calculate

Assignment Help Computer Engineering
Reference no: EM133105

Question

Algorithm Secret(A[0..n - 1])
//Input: An array A[0..n - 1] of n real numbers
minval ← A[0]; maxval ← A[0]
for i ← 1 to n - 1 do
if A[i] < minval
minval ← A[i]
if A[i] > maxval
maxval ← A[i]
return maxval - minval

a. What does this algorithm calculate?

b. What is its essential operation?

c. How many times is essential operation executed?

d. What is the effectiveness class of this algorithm?

e. propose a development or a better algorithm altogether and indicate its effectiveness class. If you cannot do it, try to prove that, in fact, it cannot be completed.

Reference no: EM133105

Questions Cloud

Write down python program : Write down Python program
An account of the historical development of social policy : The origin of social policy is closely linked to the establishment of the Fabian society in UK. In Mauritius the history of social policy can be dated back to the French colonisation period (i) Give an account of the historical development of so..
Why are most photographic images stored in a lossy format : Why are most photographic images stored in a lossy format
Write down an sql statement : Write down an SQL statement
What does this following algorithm calculate : What does this following algorithm calculate
Display all 52 cards in a standard deck of playing cards : Display all 52 cards in a standard deck of playing cards
What is essential address field width : What is essential address field width
Write down an application that reads 3 integers : Write down an application that reads 3 integers
Describe the term tco : Describe the term TCO

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Describe mutual strategy to maintain enterprise-level system

Describe mutual strategy to maintain enterprise-level system

  How to write basic structure of an exception handler

How to write basic structure of an Exception handler a. generate an abstract class Furniture b. Declare an abstract process Discount the returns no value but accepts the cost of item

  Write down a user-defined function

Write down a user-defined function

  How to plan a wan network linking a toy manufacturing plant

How to plan a WAN network linking a toy manufacturing plant? Plan a WAN network linking a toy manufacturing plant (located in Dallas Texas) with two division centres (Los Angeles, California and Pittsburgh, Pennsylvania)

  Examine how computer forensics investigations pertain to law

Examine how computer forensics investigations pertain to law

  How can sophie use applocker

How can Sophie use AppLocker.

  What is joptionpane class or the scanner class

What is JOptionPane class or the Scanner class

  Propose a wiring plan for network servers

Propose a wiring plan for network servers.

  Explain the method to find cost of sorting the relation

Explain the method to find cost of sorting the relation In each case, how many combine passes are required?

  Data representation and logic

Representing Text and Numbers, Binary Arithmetic, Interpreting Logical Statements, Logic Puzzle, Binary and Algorithms.

  How to concern about personal privacy, efficiency

How to concern about personal privacy, efficiency

  Suggest all sources using APA style

Suggest all sources using APA style

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd