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
When performing conflict management, it is important to identify your;
Olegator [25]
The goal of the conflict management is to limit the negative effects of a conflict. Some of the strategies used in conflict management are: <span>Accommodating , forcing, compromising, collaborating. When performing conflict management it is important to identify your benefits. Benefits are the positive aspects that arise from the conflict. </span>
6 0
3 years ago
____________ hackers break into systems legally for non-malicious reasons such as to test system security vulnerabilities
ss7ja [257]

Answer:

D) Black -hat

Explanation:

if any other colors of the hats will not work cuz the only way to go dark and scary is to use the black hat

4 0
3 years ago
Read 2 more answers
What is the computer?​
DiKsa [7]

Answer:

an electronic machine that can store, find and

8 0
3 years ago
Universal Container sales reps can modify fields on an opportunity until it is closed. Only the sales operations team can modify
spayn [35]

Answer:

The answer is D. Use multiple record types, page layouts, and profiles

Explanation:

Universal container sales reps can modify fields on an opportunity until it is closed. Only the sales operations team can modify the post close follow up date and post close followup comments fields. How to make this happen

A. Use field-level security on page layouts to restrict editing fields

B. Use field-level security to mark fields as read=only on the sales profile

C. use record types with field sets and restrict editing fields using field-level security

D. Use multiple record types, page layouts, and profiles

3 0
3 years ago
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a
allsm [11]

Answer:

The code is below. The output is "Eric went to Chipotle to buy 12 different types of Cars"

Explanation:

import java.util.scanner;

public class labprogram {

    public static void main (string [ ] args) {

    scanner scnr = new scanner (system.in) ;

    string firstname;

    string genericlocation;

    int wholenumber;

    string pluralNoun;

   firstName = scnr.next();

   genericLocation = scnr.next();

   wholeNumner = scnr.nextInt();

   pluralNoun = scnr.nextLine();

   system.output.println(firstname + " went to " + genericlocation + " to buy " + wholenumber + " different types of " + pluralnoun + " . ");

}

 }

6 0
3 years ago
Other questions:
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • A forensic investigation discovered that accounts belonging to employees who were terminated numerous years ago were recently us
    9·1 answer
  • Access Control can be defined as putting controls (or countermeasures) in place to help achieve information security goals. Whic
    13·2 answers
  • What is a computer OPERATING SYSTEM?
    5·1 answer
  • Discuss the difference between a broad internet search and a narrow internet search?
    12·2 answers
  • Which computer was part of the first generation of computers?
    14·2 answers
  • What type of formula uses data from multiple worksheets
    6·1 answer
  • You are asked to write a program that prompts the user for the size of two integer arrays, user input for the size must not exce
    13·1 answer
  • Attach 2 screen shots demonstrating an understanding of file management tools, such as keyboard shortcuts, copy, paste, delete,
    8·1 answer
  • Retype the below code. Fix the indentation as necessary to make the program work.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!