Professional Documents
Culture Documents
com
home / study / engineering / computer science / computer science questions and answers / sort the given array using insertion sort. sho
Question: Sort the given array using insertion sort. Show the steps of
Sort the given array using insertion sort. Show the steps of
your simulation.
Expert Answer
Solution
---
FIrst
Iteration
key=76
---
Second
Iteration
key=172
76<172
https://www.chegg.com/homework-help/questions-and-answers/sort-given-array-using-insertion-sort-show-steps-simulation-4-76-172-1-87-93-666-cod… 1/5
7/10/2021 Sort The Given Array Using Insertion Sort. Show Th... | Chegg.com
---
Third
Iteration
key=-1
-1<172
swaps 172,-1
still
-1<76
seaps 76,-1
-1<4
swaps -1,4
---
Fourth
Iteration
key=87
87>-93
---
Fifth
Iteration
key=-93
---
Sixth
iteration
key=666
---
https://www.chegg.com/homework-help/questions-and-answers/sort-given-array-using-insertion-sort-show-steps-simulation-4-76-172-1-87-93-666-cod… 2/5
7/10/2021 Sort The Given Array Using Insertion Sort. Show Th... | Chegg.com
Seventh
Iteration
Textbook Solutions Expert Q&A Study Pack Practice
Explanation
Step
1
Step
2
Step
3
move the greater value one position up to make space for the
swapped value
---
good luck
Comment
tight
recurrence tree method
asymptotic bounds for (a)
these
T(n) = 2T(n/2) + 1 (b) T(n)
recurrences: a) T(n) = =
See more questions
2T(n/4)
3T(n/3) + n for subjects you study
+ 1 b) T(n) = 2T(n/4) + n1/2
c)
A: See
answer Textbook Solutions Expert Q&A Study Pack Practice
A: See answer
Show more
COMPANY
CHEGG NETWORK
CUSTOMER SERVICE
https://www.chegg.com/homework-help/questions-and-answers/sort-given-array-using-insertion-sort-show-steps-simulation-4-76-172-1-87-93-666-cod… 4/5
7/10/2021 Sort The Given Array Using Insertion Sort. Show Th... | Chegg.com
https://www.chegg.com/homework-help/questions-and-answers/sort-given-array-using-insertion-sort-show-steps-simulation-4-76-172-1-87-93-666-cod… 5/5