70 likes | 213 Views
Insertion. size = 26. 2. 26. 10. 18. 21. 29. 27. 57. 20. 47. 37. 69. 69. 29. 58. The heap to start with. 86. 90. 31. 94. 55. 98. 71. 95. 85. 79. 91. Insertion. size = 27. 2. Increment the size. 26. 10. 18. 21. 29. 27. 57. 20. 47. 37. 69. 69. 29. 58.
E N D
Insertion size = 26 2 26 10 18 21 29 27 57 20 47 37 69 69 29 58 The heap to start with... 86 90 31 94 55 98 71 95 85 79 91
Insertion size = 27 2 Increment the size 26 10 18 21 29 27 57 20 47 37 69 69 29 58 25 86 90 31 94 55 98 71 95 85 79 91 Insert 25
Insertion size = 27 2 26 10 18 21 29 27 57 20 47 37 69 69 29 58 while(A[i] < A[i/2]) { swap(A[i],A[i/2]); i = i/2; } 25 86 90 31 94 55 98 71 95 85 79 91 Insert 25
Insertion size = 27 2 26 10 18 21 29 27 57 20 47 37 69 25 29 58 while(A[i] < A[i/2]) { swap(A[i],A[i/2]); i = i/2; } 69 86 90 31 94 55 98 71 95 85 79 91 Insert 25
Insertion size = 27 2 26 10 18 21 25 27 57 20 47 37 69 29 29 58 while(A[i] < A[i/2]) { swap(A[i],A[i/2]); i = i/2; } 69 86 90 31 94 55 98 71 95 85 79 91 Insert 25
Insertion size = 27 2 25 10 18 21 26 27 57 20 47 37 69 29 29 58 while(A[i] < A[i/2]) { swap(A[i],A[i/2]); i = i/2; } 69 86 90 31 94 55 98 71 95 85 79 91 Insert 25
Insertion size = 27 2 25 10 18 21 26 27 57 20 47 37 69 29 29 58 69 86 90 31 94 55 98 71 95 85 79 91