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
rewona [7]
3 years ago
8

Given an list of N integers, Insertion Sort will, for each element in the list starting from the second element: Compare the ele

ment with the previous element If the previous element is greater than the element in question (EIQ), push the index of the previous element up 1 Repeat step two with the element before the previous element, and so on. Once an element has been reached that is less than the EIQ, stop pushing and insert the EIQ into the spot ahead of this element (or at the beginning of the list, if it is reached instead).

Computers and Technology
1 answer:
Elena L [17]3 years ago
8 0

Answer:

def insSort(arr):

ct=0;

for i in range(1, len(arr)):

key = arr[i]

j = i-1

while j >=0 and key < arr[j] :

arr[j+1] = arr[j]

j -= 1

ct=ct+1;

arr[j+1] = key

return arr,ct;

print(insSort([2,1]))

Output of the program is also attached.

You might be interested in
Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
nexus9112 [7]

Answer:

The answer is the last choice that is "None of these values will produce a mathematical error".

Explanation:

In this question, the above given choice correct because neither of the flowchart procedures could trigger a mathematical error. This error could not be induced by multiplication, addition and subtraction, and the only division by 15. It is the only divide by 0, that's why the above flowchart will produce a mathematical error.

4 0
3 years ago
Identify and explain the three tiers of web-based applications.
prisoha [69]

In the case of three-tier architecture, the tiers are as follows: Presentation tier (also known as the user interface or the client application) Business logic tier (also known as the application server) Data storage tier (also known as the database server)

This was on google i take no credit for this work

Btw I don´t know if this is what u want

7 0
2 years ago
When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.
faltersainse [42]

Answer:

Parameter

Explanation:

q: When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.

a: Parameter

3 0
3 years ago
Pollution or waste that is generated from a business is called a
vredina [299]
It is most commonly called "Waste Stream".
8 0
3 years ago
Read 2 more answers
Sanjay is giving a slideshow presentation on his entire college class and he is feeling quite nervous in order to share his pres
Likurg_2 [28]
I think that would be the (HDD) Hard Disk Drive! Hope this helps!
8 0
3 years ago
Other questions:
  • What key combination in excel takes you back to the first cell
    7·1 answer
  • Windows Live SkyDrive is an example of _____ storage.
    13·1 answer
  • When Lisa purchased her house the mortgage lender required homeowners insurance to cover 100% of the loan amount. After many yea
    7·2 answers
  • Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the
    12·1 answer
  • Karin realized that a song takes up a lot more space on her computer than the lyrics of the song typed out in ms word document .
    12·1 answer
  • What is Data rate?<br> What is BAUD RATE?<br> What is bandwidth?
    8·1 answer
  • Trojans depend on ________ to spread. A rootkits B self-replication C code injection D social engineering
    14·1 answer
  • Why is it useful to understand coding fundamentals even if you work in a game design role that doesn’t traditionally write code?
    9·1 answer
  • While working in a group of two the members are not getting along. You bring the two members together so they can discuss this i
    11·1 answer
  • Which is government departments fund the Global Positioning System
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!