Below are links to two standard algorithms (from Problem Solving with Algorithms and Data Structures using Python): Each has a counter to keep track of how many comparisons are made.

Test the code with the following input lists. Which algorithm makes fewer comparisons for:

Submit your groups' answers to the following questions:

  1. What input data is worst (i.e. takes the most number of comparisons to sort) for insertion sort?
  2. What input data is the best (i.e. takes the least number of comparisons to sort) for insertion sort?
  3. What input data is worst (i.e. takes the most number of comparisons to sort) for merge sort?
  4. What input data is the best (i.e. takes the least number of comparisons to sort) for merge sort?