Link to home
Start Free TrialLog in
Avatar of veeaechone
veeaechone

asked on

C++ selection sort and insertion sort

I would like it if someone would check my answers to make sure I am understanding the sorts properly.  Please and thank you.

Consider the array based list of (10, 4, 8, 2, 7) as input for selection sort and insertion sort algorithms in the following questions:

The number of comparisons made by the selection sort is:   3
The number of comparisons made by the insertion sort is:   7
Note that each swap requires 3 moves.  The number of moves made by the selection sort is:   9
The number of moves made by the insertion sort is:   7
ASKER CERTIFIED SOLUTION
Avatar of jhp333
jhp333
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of veeaechone
veeaechone

ASKER

Got it!  Thanks for your help!