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
Interpretations of​ Moore's law assert​ that:
jonny [76]

Answer:

Option (D) is the correct answer of this question.

Explanation:

Moore's Law relates to Moore's theory that the number of transistors on a microchip doubles every two years while device costs are halved.

Interpretations  of Moore's law assert the computing power doubles every 18 months.The Moore's Law theory states that development is exponential.Moore's Law states that every couple of years we should expect our computers to increase their speed and capacity and we'll pay less for them.h

Option(A),Option(B) ,Option(c) and option(E) do not belongs to Moore's law  so these options are incorrect options.

5 0
3 years ago
Disk quotas are set using the ____ console. diskpart disk management mst windows explorer
liraira [26]
<span>Answer: Disk Management Console</span>
8 0
3 years ago
What is looping in QBASIC​
Elden [556K]

A looping is a set of instructions which is repeated a certain number of times until a condition is met. hlo dai k xa halkhabar

3 0
3 years ago
71 81 77 15 63 96 36 51 77 18 17
sp2606 [1]

Answer:

Following are the solution to this question:

Explanation:

This algorithm uses the divide and rule approach works, which splits the list into two sublists depending on if they are smaller or larger than the pivotal factor. It has O(n*log n) complexity.

It splits down the list in more than one version frequently till every sublist becomes based on a single element and fuses it to offer an ordered array. The merge type works according. It has O(n*log n) complexity.

Please find the attachment file of the sorting.

4 0
3 years ago
Two functions of the UPS​
Angelina_Jolie [31]

Answer:

UPS is abbreviation of Uninterrupted power supply. It is a battery backup devices useful when major supply is interrupted due to any reason.

It performs the following functions:

1. It provides protection from power surges.

2. Smooth out noisy power sources

5 0
3 years ago
Read 2 more answers
Other questions:
  • Thomas Hill claims that a fruitful way to think about the badness of destroying the environment is
    15·1 answer
  • The page orientation in which the page width is greater than the page height is called
    8·1 answer
  • Write a program in which given an integer num, return the sum of the multiples of num between 1 and 100. For example, if num is
    7·1 answer
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    7·1 answer
  • How is this fictional tex in the people could fly different from the nonfictional text​
    12·2 answers
  • What can a scientist do if he repeats and experiment and gets diffrent results?
    5·1 answer
  • Please write a Java program to read movies.txt file. (It is in Modules under Chapter Code) Create your own movies.ser file from
    14·1 answer
  • If the tax percent is 15% and tax is $36 and percent discount is 10, what is the cost price?​
    12·1 answer
  • Which of the following was most likely used to apply red background and font to some of the cells in column D?
    10·1 answer
  • An epic games service is unavailable at the moment
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!