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
Xelga [282]
3 years ago
15

One of the most studied computational problems is the ordering of a collection of values. Ordering is important because many pro

blems set on collections of values become easy if the elements of the collection are ordered.
Sorting by selection is an example of sorting algorithm.

This algorithm consists of the following steps:

1. It is looked for in the part disordered by the smaller element and it is changed the smaller element with the element under the marker.

2. A marker is used to divide the ordered and disordered parts of the vector. The value 0 is assigned to the bookmark.

3. The marker is advanced.

4. The process repeats until there is only one element from the marker.

Check the alternative that shows the correct ordering of the steps of the sort ordering algorithm.

Alternatives:

The)
1 - 2 - 3 - 4.

B)
1 - 2 - 4 - 3.

w)
2 - 1-4.

(d)
2 - 1-3.

and)
2-3-1-4.
Computers and Technology
1 answer:
andreyandreev [35.5K]3 years ago
7 0

I think the order should be 2-1-3-4, but the description of step 1 is confusing. In selection sort, you iterate from the point of the marker down through the entire list and find the smallest value, and swap that with the value at the marker. Then you advance the marker and repeat the process on the remainder of the list.

You might be interested in
Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
Alenkinab [10]

Answer:

#section 1

def maxTemp(filename):

   import pathlib

   f = pathlib.Path(filename)

   f.exists()

   if f.exists():

       f = open(filename, "r")

#section 2

       next(f)

       res = [int(sub.split(',')[1]) for sub in f]

       maxdata = (res[0])

       for i in range(len(res)-1):

           if maxdata < res[i]:

               maxdata = res[i]

       

       index = res.index(maxdata)

       f.close()

 #section 3  

       li = []  

       a = open(filename, "r")

       for line in a:

           line = line.strip()

           li.append(line)

   

       

       a.close()

       return (li[index+1])

   else:

       return -1

print(maxTemp("new.csv"))

Explanation:

#section 1:

The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.

#section 2:

We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.

<em>res = [int(sub.split(',')[1]) for sub in f] </em>

The maximum number is gotten by using the if statement to compare all elements in the list.  The index of the maximum item in the list is collected.

the file is then closed.

#section 3  :

The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.

8 0
3 years ago
Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
dimulka [17.4K]
I don’t know ‍♀️ sorry
7 0
2 years ago
Any please answer this How much resistance is required to gen-erate 50 mA of current from a 5 volt bat-tery?
nasty-shy [4]

Answer:

Calculating Currents: Current in a Truck Battery and a Handheld Calculator ... (b) How long does it take 1.00 C of charge to flow through a handheld calculator if a 0.300-mA current is ...

7 0
2 years ago
Virtualization:
Sedaia [141]

Answer:

C. can boost server utilization rates to 70% or higher.

Explanation:

Virtualization -

It is the process of running virtual instance of the computer in the abstracted layer from the very actual hardware , is known as virtualization .

In this process multiple operating system can be operated on the single computer setup , it is useful for increasing the speed of the program.

Hence, from the question,

The correct statement with respect to virtualization is C. can boost server utilization rates to 70% or higher .

8 0
2 years ago
6.8 Code Practice<br> please can have some help please
babymother [125]
Sure what is the question though
7 0
2 years ago
Other questions:
  • Diane wants to maintain a record of grades scored in the fifth, sixth, and seventh grades. She enters her grades and the total p
    13·1 answer
  • video-sharing sotes such as youtube and vimeo provide a place to post short videos called clips true or false?
    5·1 answer
  • What is the main role of LDAP?
    14·1 answer
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • Advantages of heading attributes
    5·1 answer
  • Which finger presses the Shift key on the keyboard?
    6·2 answers
  • You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.25
    12·1 answer
  • Hello my name is Phoenix I will like for you to friend me on Ro blox my user name is Jessiahcoleman and if u play BLOX fruits or
    13·1 answer
  • When solving a problem in a group situation, which of the following traits should be demonstrated?
    8·1 answer
  • Do you guys answer questions about cyber security?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!