Change the base class of sorting algorithm from interface to class