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
hodyreva [135]
3 years ago
13

Consider sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with the element in A[

1]. Then find the second smallest element of A, and exchange it with A[2]. Continue in this manner for the first n − 1 elements of A. Write pseudocode for this algorithm, which is known as selection sort. What loop invariant does this algorithm maintain? Why does it need to run for only the first n − 1 elements, rather than for all n elements? Give the best–case and worst–case running times of selection sort in Θ–notation.
Computers and Technology
1 answer:
krek1111 [17]3 years ago
7 0

Answer:

1. create the first array A

2. create the second array A1, the same length as array A.

3. create a loop to iterate over both arrays for a number of times specific to the length of the arrays, with a condition to get and pop only the minimum value of which arrays for every loop.

4. save both items to "a" for minimum value A and "b" for minimum value A1.

5. call a function to push the "a" variable value to A1 and "b" variable value to the array A.

Explanation:

This code would interchange the values of both arrays, the best-case scenario for the code is O( n ) where n is the number of items in both arrays and worst is the best-case multiplied by the number of time to compare all the items with the minimum value.

You might be interested in
Free up disk space by doing____?​
8090 [49]

Answer:

Deleting files and etc on your computer.

6 0
3 years ago
Read 2 more answers
Which phrase best describes a folder in Outlook 2016?
svetoff [14.1K]

Answer:

The phrase that describes the best folders in outlook 2016 is:

An organizational container.

Explanation:

The reasons behind this answer are that in the first place the folder allows the user to group emails, contacts, tasks, or even a calendar. So, because this is not only for emails or files. It is an object that can group several types of things and create a new category. Instead of only applying for certain objects. Thus, it is an organizational container. Because the first the third, and the fourth option describe objects that can only group-specific objects instead of all of them. There is no flexibility in the rest of the answers.

5 0
3 years ago
Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
rjkz [21]

Answer:

D. Border

Explanation:

Edge 2020

5 0
2 years ago
Why would advertising be more important in a magazine publishing than it is in a newspaper?
Bond [772]
Newspapers are irrelevant now, magazines will get you much more viewers.
3 0
3 years ago
Read 2 more answers
What is the difference between manual and computer typesetting?
Burka [1]

Answer:

Manual typesetting: The form was placed in a press, inked, and an impression made on paper. During typesetting, individual sorts are picked from a type case with the right hand, and set into a composing stick held in the left hand from left to right, and as viewed by the setter upside down.

Computer typesetting: Computerized typesetting, method of typesetting in which characters are generated by computer and transferred to light-sensitive paper or film by means of either pulses from a laser beam or moving rays of light from a stroboscopic source or a cathode-ray tube (CRT).

6 0
3 years ago
Other questions:
  • trhy356<br>yjetyi46ui y j4yhnpug 2utg[ 2[ 24[ou [o24t
    15·1 answer
  • Which of the following is not a valid FICO Credit score?
    12·2 answers
  • Each webpage is assigned a(n) ______, an address that identifies the location of the page on the Internet.
    6·1 answer
  • An organization has a website with a guest book feature, where visitors to the web site can input their names and comments about
    10·2 answers
  • What does the Finder do?
    7·1 answer
  • Describe five different ways databases can be processed
    14·1 answer
  • What is the process of attaching gage blocks to each other
    7·1 answer
  • Taylor and Rory are hosting a party. They sent out invitations, and each one collected responses into dictionaries, with names o
    9·1 answer
  • Hello pls answer<br><br><br>what is the use of loop in java​
    5·1 answer
  • Why is computer called information processing machine....?​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!