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
kramer
2 years ago
13

Let us consider the easiest sorting algorithms – Maxsort. It works as follows: Find the largest key, say max, in the unsorted se

ction of array (initially the whole array) and then interchange max with the element in the last position in the unsorted section. Now max is considered part of the sorted section consisting of larger keys at the end of the array. It is no longer in the unsorted section. Repeat this until the whole array is sorted. a) Write an algorithm for Maxsort assuming an array E contains n elements to be sorted, with indexes 0, 1,…,n-1. b) How many comparisons of keys does Maxsort do in the worst case and on average? Submit source code, test cases, results, and the answers to part (b)
Computers and Technology
1 answer:
schepotkina [342]2 years ago
3 0

Answer:

count = 0

for x in range(len(array)):

if count == Len(array) -1:

break

max = max(array[:-1 - count])

count += 1

if array.index(max) == -1:

break

else:

hold = array[-1]

array[-1] = max

array[array.index(max)] = hold

Explanation:

The python program is an implementation of a maxsort. The for loop iterates over the array, getting the maximum number for each reduced array and swaps it with the corresponding last items.

You might be interested in
Which tab should be selected to add a hyperlink within a cell? Home tab Review tab Insert tab Formula tab
Mashcka [7]

Answer:

On the Insert tab

Explanation:

  1. You would select the tab that you want the Hyperlink to be in
  2. select the <em>Insert tab</em>
  3. There you will see a panel that says<em> link</em> press the down arrow than you will see a section that says <em>link</em> again there again you will press the down arrow which will show a option of document you want to add if your looking to add a link form a web browser than at the bottom of the list you will see <em>Insert Link</em>
  4. From there you will see a box pops up there you can upload a file from your computer or PC
  5. Once the box pops up you will enter the web browser page address in the box that says <em>address</em>
  6. From there press <em>okay</em> then your hyperlink will be in the cell you want
  7. If you don't know where or what a web browser address is than on the top of the web browser where you would insert what you are searching all you have to do is press it and it will automatically highlight the text than copy and paste the text by holding <em>Ctrl + C </em>to copy and holding <em>Ctrl + V </em>to paste

6 0
3 years ago
Read 2 more answers
How many nibbles make one kilobyte​
Kazeer [188]
2000 nibbles I think correct me if I’m wrong
5 0
2 years ago
Read 2 more answers
Which of the following is a hand-drawn animation that takes a large amount of time to complete?
elixir [45]

Answer:

Where are the choices?

Thanks for adding the choices at the comment secion

  1. 2D animation
  2. 3D animation
  3. Stop Motion  
  4. Celluloid animation

A- Celluloid Animation

4 0
2 years ago
One of your start-ups uses error-correcting codes, which can recover the original message as long as at least 1000 packets are r
Marina CMI [18]

Answer:

Number of packets ≈ 5339

Explanation:

let

X = no of packets that is not erased.

P ( each packet getting erased ) = 0.8

P ( each packet not getting erased ) = 0.2

P ( X ≥ 1000 ) = 0.99

E(x) = n * 0.2

var ( x ) = n * 0.2 * 0.8

∴ Z = X - ( n * 0.2 ) / \sqrt{n*0.2*0.8}   ~ N ( 0.1 )

attached below is the remaining part of the solution

note : For the value of <em>n</em> take the positive number

5 0
3 years ago
End users have complained that when they click a link on your company's Website, the wrong client loads. You review the page wit
Ilia_Sergeevich [38]

Answer:

4. A Web server has been specified.

Explanation:

End users have complained that when they click a link on your company's Website, the wrong client loads. You review the page with the suspect link and find the following HTML code:

To begin an FTP session, click the following link:

FTP Session

The problem is that Web server has been specified.

7 0
2 years ago
Other questions:
  • Which of the following statements is true?
    11·1 answer
  • Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
    15·1 answer
  • 30
    5·1 answer
  • Analyst is investigating proxy logs and found out that one of the internal user visited website storing suspicious java scripts.
    8·1 answer
  • Which four of the following hardware components are specifically used to enable networking and are not part of a stand-alone com
    13·2 answers
  • The ________ option contains the formatting and placeholders for all of the items that appear on a side.
    11·1 answer
  • The Receiver recognizes the sounds the Sender is making and transforms them into words and ideas in his own mind. What is this
    5·1 answer
  • Uploading Your Work
    14·1 answer
  • Critical Thinking Questions
    9·2 answers
  • Assume variable age = 22, pet = "dog", and pet_name = "Gerald".
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!