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
Determine if x(t) is periodic and determine the fundamental period.
Studentka2010 [4]

Answer:

hdiihgguilmjj jduhuiuedoibb

6 0
3 years ago
A presentation on the history of the Internet would mostlikely use the ____ pattern of organizationSpatialproblem-solutionchrono
m_a_m_a [10]

Answer:

topical

Explanation:

A presentation on the history of the Internet would mostlikely use the topical  pattern of organization.

3 0
3 years ago
In order to view the permissions assigned to each type of user for all the files located in a directory, which of the following
Rufina [12.5K]

The correct answer is B: ls -l.

Further Explanation:

In Linux there is a specific command needed to look at the files in a directory. In addition to using the command ls -l, you will need to use < > after the command and insert the name of the file that is being looked for. For example: ls -l <root root 2356 0600 Oct 22 lanyard>.

Each word and character has their own meaning and access information stored in the database. This will also show the users accesses permission to see the file and if needed to write over the file.

Learn more about computer commands at brainly.com/question/13338803

#LearnwithBrainly

5 0
3 years ago
You completed the wireframe step of mobile app development. Which statement is true about this step?
UkoKoshka [18]

The statement that is true about this step is that:

  • You have drawn pictures of what your screens will look like and identified the input-process-output that occurs on each screen.
  • In this step, you defined your target audience and main goal.

<h3>How wireframe is made to create mobile apps?</h3>

The Steps for wireframing are:

  • Begin by mapping out a specific user flow.
  • Do a Sketch of the core part and then begin wireframing by setting a Mobile Frame.
  • Se the layout using boxes and use design patterns.
  • Make sure to link the pages together to create a flow.

Note that The statement that is true about this step is that:

  • You have drawn pictures of what your screens will look like and identified the input-process-output that occurs on each screen.
  • In this step, you defined your target audience and main goal.

Learn more about wireframe  from

brainly.com/question/12734458

#SPJ1

5 0
2 years ago
ก
Harrizon [31]

Answer:

Rubies are used in electronics.

 

Please select the best answer from the choices provided

T

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
    6·2 answers
  • What is the job title of someone who works with video and/or film?
    9·1 answer
  • 20 points
    7·1 answer
  • Which alignment aligns text to the left and right side margins?
    15·1 answer
  • A variable is assigned a value on line 328 of a program. Which of the following must be true in order for the variable to work?
    12·2 answers
  • What is collaboration
    14·1 answer
  • Read the introduction (paragraphs 1-3].
    7·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.
    13·1 answer
  • After a group sets a project schedule, members should be prepared to
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!