We learned about six sorts, five of which use comparisons:
You are going to incorporate into the sorts instructions that will count the number of comparisons AND the number of data moves that the sort perform. You will print this out.
You will use the following sets of data:Set 1: 69 79 75 55 73 39 49 58 26 18 71 48 25 69 92 56 72 20 13 95 59 40 64 37 66 73 73 31 28 47 24 91 40 72 26 54 76 12 69 87 70 63 49 37 29 73 31 58 53 18 Set2: 12 13 18 18 20 24 25 26 26 28 29 31 31 37 37 39 40 40 47 48 49 49 53 54 55 56 58 58 59 63 64 66 69 69 69 70 71 72 72 73 73 73 73 75 76 79 87 91 92 95 Set3: 95 92 91 87 79 76 75 73 73 73 73 72 72 71 70 69 69 69 66 64 63 59 58 58 56 55 54 53 49 49 48 47 40 40 39 37 37 31 31 29 28 26 26 25 24 20 18 18 13 12
Please note that these contain the same data, but in random, ascending and descending form respectively. You can find the code here