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

  Security policy document project

Analyze security requirements and develop a security policy

  How to draw a hierarchy chart

How to draw a hierarchy chart

  What will be formula of digital certificate of the server

Point out what will be the formula of digital certificate of the server N. we denote the public and private keys of server N as K+ ,N KN, and public or private keys of CA are denoted as K+ CA KCA.

  Purpose and use of the java adapter classes

Purpose and use of the Java Adapter classes

  Program of five to ten lines in assembly language

Program of five to ten lines in assembly language

  Program to find smaller between num1 and num2 to output

Program to find smaller between num1 and num2 to output

  Describe the term tco

Describe the term TCO

  Write down an application that reads 3 integers

Write down an application that reads 3 integers

  Utilize linked stack class to support an application

Utilize Linked stack class to support an application

  Generate the tables attach the primary key and foreign key

Generate the tables attach the primary key and foreign key

  Write program that generates casual number between 1 and 100

Write program that generates casual number between 1 and 100?

  Create an xml document containing information

Create an XML document containing information.

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