invalid new-expression of abstract class type error

You aren’t actually overriding the sort function, so MergeSort is still an abstract class:

Sort::sort(int A[], int size)= 0;
MergeSort::sort(int A[], int size, int low, int high);      // main entry point

These sorts have different signatures, so they are different functions.

To solve this, you either need to change your MergeSort::sort method to not take in a low and high argument, or to add a low and high argument to your other sort methods.

Leave a Comment