1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nataly [62]
2 years ago
15

The range of a finite nonempty set of $n$ real numbers $S$ is defined as the difference between the largest and smallest element

s of $S$. For each representation of $S$ given below, describe an algorithm in pseudo code to compute the range. Indicate the time efficiency classes of these algorithms using Big-$O$.
Computers and Technology
1 answer:
-Dominant- [34]2 years ago
7 0

Answer: Hello your question is poorly written attached below is the well written question

answer:

a) Determine ( compute ) the difference between the max and minimum value. determine the Min and max values using 1.5n comparisons

  time efficiency = θ( n )

b) A(n-1) - A(0)

  time efficiency = θ( 1 )

Explanation:

a) An unsorted array

To find the maximum and minimum values scan the array of elements , then determine ( compute ) the difference between the max and minimum value. to determine the range. Alternatively determine the Min and max values using 1.5n comparisons

Algorithm's time efficiency = θ( n )

b) A sorted array

To determine the range, we will determine the difference between the first and last element i.e. A(n-1) - A(0)

time efficiency = θ( 1 )

You might be interested in
Why is it important to explore an Integrated
dezoksy [38]

Answer:

The answer to this question is given below in the explanation section. The correct answer is B.

Explanation:

The purpose behind to explore an integrated development environment is to learn more about the features of the environment.

So the correct answer is B.

For example, you can use visual studio to build asp.net application using c#, then you need to explore what features visual studio offering to you.

However, other options are incorrect. Because, you can learn more about syntax, error handling, and abstraction in the programming language, not in the IDE.

6 0
3 years ago
Write an algorithm that receives a number from the user (you can store the number in a variable called N). Then the algorithm sh
lbvjy [14]

Answer:

Algorithm:

1. Declare an integer variable N.

2. Read the value N from user.

3.While(N):

 3.1 find r=N%10;

 3.2 print r in new line.

 3.3 Update N as N=N/10.

4.end program.

Implementation in C++.

// header

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int N;

cout<<"Enter an Integer:";

   cin>>N;

// find the digits of number

   while(N)

   {

       // last digit

       int r=N%10;

       // print last digit

       cout<<r<<endl;

       // update the number

       N=N/10;

}

return 0;

}

Output:

Enter an Integer:329                                        

9                                                          

2                                                          

3

7 0
3 years ago
PLEASE ANYONE!!which present margins would be best to get the most information to fit on the page​
-Dominant- [34]

Answer:

Normal Margin is fit on the page. The default margins for Microsoft Word is normal margin.                                      

Explanation:

The paper visual effect give the document’s theme and quality. Margins send visual effects. Making a document right helps you to send the right message to readers. Use a small paper and adding a border.

You can change the page layout that people notice first with size, orientation, and margins.

Page margins make your document readable. Margins make the document more readable, make text look inviting, and given reviewers.

With narrower margins, you can reduce more words on-page.

To many words in a line make it difficult to read the document.

Margins are of many types

  • Normal Margin
  • Narrow margins
  • Moderate margins
  • Wide margins

Normal gives an equal inch to all sides of the page.

Narrow margins give little room to each column.

Average margins squeeze words from left and right.

Wide gives space when proofing the manuscript.

3 0
3 years ago
Read 2 more answers
Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
enot [183]

Answer:

b)void aNonclassFunction (Banana co);

Explanation:

In the function definition you have to pass the tell the function which type of argument it is taking.In our case we are taking a variable co of Banana type passing it to the function named aNonclassFunction having no return type.

So the definition will be like this.

void aNonclassFunction (Banana co);

6 0
3 years ago
Besides technical skill, what is the most important factor for staying employed and being offered promotions?
Natali [406]

Obtaining a college degree= while this is nice, you can get a lot of placed with just a GED or Highschool Degree

pursuing self-directed learning=this will help you

showing professional behavior= yes this helps a lot

setting long-term goals= this could help you in the end game

Overall, i think it would be between B and C, though C sounds correct over B because even if you pursue self directed learning, you could still get fired or quit or not get a promotion.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following options would you use when saving a document with a new filename? *
    12·2 answers
  • Microcomputers, different from those giant mainframes and supercomputers, are designed for individuals. In fact, the microcomput
    7·1 answer
  • Is USA TestPrep a test-taking site that won't let you access other windows without kicking you off?
    13·1 answer
  • Please help I really need it
    7·1 answer
  • What specific authentication method has no encryption for user credentials or data, and is not recommended for most applications
    14·1 answer
  • If we want to access files located in a directory on a remote server, which of these options would we use?
    9·2 answers
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • How did transistors revolutionize the world of computers?
    15·1 answer
  • When was the first analog device, the phonautograph, launched?
    14·1 answer
  • What was one effect of better printing methods during the Ming Dynasty? Updated trade routes A new merchant class Increased lite
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!