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
MaRussiya [10]
3 years ago
11

2.2-2 Consider sorting numbers stored in array by first finding the smallest element n A of and exchanging it with the element i

n . Then find the second smallest A AOE1 element of A, and exchange it with . Continue in this manner for the firs AOE2 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 firs elements, rather than for all elements? Give the best-case n 1 n and worst-case running times of selection sort in ‚-notation.
Computers and Technology
1 answer:
True [87]3 years ago
7 0

Answer:

Follows are the explanation of the choices:

Explanation:

Following are the Pseudocode for selection sort:                      

for j = 0 to k-1 do:

      SS = i

      For l = i + 1 to k-1 do:

        If X(l) < X(SS)

          SS= l

        End-If

      End-For

      T = X(j)

      X(j) = X(SS)

      X(SS) = T

    End-For

Following are the description of Loop invariants:

The subarray  A[1..j−1] includes the lowest of the j−1 components, ordered into a non-decreasing order, only at beginning of the iteration of its outer for loop.  

A[min] is the least amount in subarray A[j.. l−1] only at beginning of the each loop-inner iterations.                      

Following are the explanation for third question:

Throughout the final step, two elements were left to evaluate their algorithm. Its smaller in A[k-1] would be placed as well as the larger in A[k]. One last is the large and medium component of its sequence because most and the last two components an outer loop invariant has been filtered by the previous version. When we do this n times, its end is a repetitive, one element-sorting phase.

Following is the description of choosing best-case and worst-case in run- time:

The body the if has never been activated whenever the best case time is the list is resolved. This number of transactions are especially in comparison also as a procedure, that will be (n-1)(((n+2)/2)+4).    

A structure iterator at every point in the worst case that array is reversed, that doubles its sequence of iterations in the inner loop, that is:(n−1)(n+6) Since both of them take timeΘ(n2).

You might be interested in
A keyboard shortcut is a key or combination of keys that you press to access a feature or perform a command. ___________________
andrey2020 [161]
I believe that this is true.
Ctrl+F
Ctrl+C
Ctrl+V
These are all keyboard shortcuts.

8 0
3 years ago
While working independently, you need to weigh your options on a topic. You research and analyze the topic so you can ensure you
Andrews [41]
I think this process would be Decision-Making, because the scenario is that you have to decide on what topic you are going to pick, based on research and what you think would be the best resolution. I don't think that Conflict resolution would be correct because there is no conflict and neither Negotiation nor Verbal Communication have anything to do with this, so i believe it's safe to assume the correct answer would be Decision Making.
8 0
3 years ago
Read 2 more answers
Several of the items below indicate the steps required to add a slide to a presentation. Select those steps and indicate the ord
ss7ja [257]

Answer:

Click on the New Slide icon.  2.

Enter the slide position desired. N/A

Click where you want to add the slide.  1.

Select New Slide from the Tools menu.  3.

Switch to the Normal or Slide Sorter view. 4.

Switch to the Notes or Outline view. 5.

Explanation:

You can never enter the slide position desired, and you need to click on the slide after which you want the new slide to be placed.  Thus, enter the slide position desired is not applicable, and you need to click where you want to add the slide, and more accurately after which. Hence, this is the 1st. Now you need to click on the new slide icon. Then you need to select the new slides from the tools menu. The slide will appear in Normal view, and you can design the slide now as well as add the notes. You can then move to slide sorter view to arrange the slides, or you can arrange from the slide tab as well. Finally to check(edit) the notes and outline you can change the view to notes or Outline view. Hence, the above answer.

Keep in mind that through presenter view, you can make the slide show where you can see the slides and your notes, and the listeners can see the slides only.

7 0
2 years ago
What technology uses mathematical algorithms to render information unreadable to those lacking the required key
hoa [83]

Data encryption is the name of the technology that uses mathematical algorithms to render information unreadable to those lacking the required key.

<h3>What is Data encryption technology?</h3>

This is a technology that helps to secure data by applying a technique known as cryptography. What this basically means is that a secret code (or key) is generated which would provide access to the cryptographically stored information, and failure to provide the correct key makes the data or information unreadable.

You can learn more about how data encryption works here brainly.com/question/9238983

#SPJ1

6 0
1 year ago
Davis wants to attach a scanner to his computer. How will he do this?
Aleksandr [31]
It would often connect via a universal serial bus (USB) cable, so answer [B].
8 0
3 years ago
Read 2 more answers
Other questions:
  • I need the code for Assignment 5 Animation in Edhesive, its in python code.
    9·1 answer
  • ________ are the most popular method used by visitors to find web sites.
    6·1 answer
  • Write the definition of a function max that has three int parameters and returns the largest.
    6·2 answers
  • A collection of wiress connecting the CPU with main memory that is used to identify particular location is called
    13·1 answer
  • 1.
    9·1 answer
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • An individualized course plan for the 4 years of
    15·2 answers
  • Which TWO of these correctly describe a Trojan horse malware?
    11·2 answers
  • In “Plugged In,” the author’s purpose is to persuade. Which of the following quotes from the text shows that the author’s purpos
    15·1 answer
  • Question 12 (5 points)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!