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
3 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]3 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
Funtion is excel define​
nydimaria [60]

Explanation:

Excel includes many common functions that can be used to quickly find the sum, average, count, maximum value, and minimum value for a range of cells.

5 0
3 years ago
Physical security controls traditionally include obstacles, alarms, lights, guards, cameras, and responders that produce a(n) __
Lostsunrise [7]

Answer:

secure facility

Explanation:

7 0
3 years ago
Point: A Point in a two dimensional plane has an integer x coordinate value and an integer y coordinate value.
UNO [17]

Answer:

They are connected

Explanation:

8 0
3 years ago
Integrity constraints are enforced by Group of answer choices A. The operating system B. The end user C. The database designer D
slega [8]

Integrity constraints are enforced by The database designer.

<h3>What are Integrity constraints?</h3>

An  Integrity Constraints is known to be the protocols that a table's data columns is mandated to follow.

Note that they are used to hinder the types of information that can be put into a table and as such, Integrity constraints are enforced by The database designer.

Learn more about Integrity constraints from

brainly.com/question/28026113

#SPJ1

4 0
2 years ago
Rochelle knows that the music on her computer is stored in the form of numbers. Which hardware component processes these numbers
QveST [7]

Answer:

ALU: arithmetic logic unit

Explanation:

Hope this helps i dont know that much about thus unit but i am pretty sure im right

4 0
3 years ago
Other questions:
  • What is the highest payed country
    9·1 answer
  • Multiple choice
    9·2 answers
  • Create an application that lets the user enter the food charge for a meal at a restaurant. When a button is clicked, the applica
    13·1 answer
  • What two items must be given to the socket function in order to create a socket object? A) The socket type that will be used. B)
    10·1 answer
  • How have productivity programs improved the professional lives of people? (check all that apply)
    8·2 answers
  • Access-lists pose a logical problem which often has more than one solution. Can you think of a different set of rules or placeme
    8·1 answer
  • You are supposed to do a report on something that interests you. You decided to do a report on dogs. As you research, you take n
    14·1 answer
  • Private void finishMap()
    7·1 answer
  • Find the error in the following code fragment. int a: System.out.print(a):​
    12·1 answer
  • The first time that a particular visitor loads a web site page is called a(n) _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!