subject

Suppose that you want to sort an array into ascending order using insertion sort. the array contains the integers 0 through n in some order, where n is even and n > 2. (that means it contains n+1 integers! ) during the quiz, you will be asked how many comparisons are performed in various situations. this refers to comparisons of the array elements being sorted. in each case, express your answer as a polynomial in simplest terms

a)

suppose the array begins with 0, followed by the remaining even numbers in ascending order, followed by the odd numbers in descending order. (for n = 8, the array would be [0,2,4,6,8,7,5,3,1].)

how many comparisons will insertion sort perform when it is executing the pass that moves the element at index 1 into position? (do not assume n = 8.)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Along what line of action can the camera move to follow the movement of actors for screen direction? a. along a 90-degree arcb. along a 120-degree arcc. along a 180-degree arcd. along a 360-degree arc
Answers: 1
You know the right answer?
Suppose that you want to sort an array into ascending order using insertion sort. the array contains...
Questions
Questions on the website: 13722361