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
Grace [21]
3 years ago
7

Why do Selection Sort and Insertion Sort’s outer loops run 11 iterations if there are 12 elements in the array?

Computers and Technology
1 answer:
laiz [17]3 years ago
3 0

Answer:

The final case in selection sort is trivially sorted.

The final iteration in insertion sort is not needed.

Explanation:

For selection sort, you make sub arrays and find the smallest element placing it in the front and repeat until sorted.  This guarantees the final element will already be the greatest element, thus it is trivially sorted.

For Insertion sort, you use the initial element and compare it to the previous element and swap if the current is larger than the previous.  Using this sort, you will always perform n-1 comparisons where n is the total amount of elements in the array.  Thus, there are only 11 iterations for a 12 element array.

Cheers.

You might be interested in
Q.drtrdyudoijoemrkdf
sveta [45]

Answer:

Yes

Explanation:

8 0
2 years ago
Read 2 more answers
Which two approaches optimize test maintenance and support future declarative configuration changes? Choose 2 answers Create a m
patriot [66]

Answer:

B and C

Explanation:

B. Create a method that load valid account records from a static resource, then call this method within test method

C. Create a method that creates valid records, then call this method within test methods

3 0
2 years ago
Windows hard disks can now use a variety of file systems, including FAT16, FAT32, ____, and Resilient File System.
marysya [2.9K]

Answer:

NTFS.

Explanation:

3 0
2 years ago
What is true about music from the Romantic period?
avanturin [10]
The answer to the given question above is the third option: <span>It was longer and less constrained than the music of the Classical period. The Romantic Period in music actually has more freedom in design and form. During this period, music were even more artistic and intellectual as well. Romantic Period occurred the late 18th century until early 19th century.</span>
8 0
2 years ago
Read 2 more answers
What are examples of intermediate goals that require funding? Check all that apply.
SashulF [63]
2.) Attending college
3 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) ____________________ or cryptosystem is an encryption method or process encompassing the algorithm, key(s) or cryptovariabl
    11·1 answer
  • If you want to emphasize the Greek root of a word in a document, which tool in Microsoft® Word could you use?
    6·2 answers
  • On hearing my name, you may think that I am iterative, but I play a vital role in networking by boosting the signal strength to
    13·1 answer
  • Quick time and flash are two examples of what product
    11·1 answer
  • How would Microsoft Word inform you of the error in the sentence below? (Tip: The error is in bold.)
    7·1 answer
  • Web 2.0 has led to a shift just from consuming content towards what
    6·1 answer
  • Mobile phones that function as credit cards are called _____.
    11·1 answer
  • What’s the most popular operating system
    9·2 answers
  • If you were required to give a speech identifying the risks of using computers and digital devices, which group of items would y
    7·1 answer
  • What is the best stratiget to avoid paying intrest in your credit cared
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!