Originally Posted by
tabstop
So I'm not entirely sure why you want to combine these two classes, as they're not the same "category" to me. A heap is a container (granted a container that obeys some properties), while quicksort is a way to sort things that are contained elsewhere and does not contain any information in itself. Put another way: a heap is a noun, quicksort is a verb. I would expect trying to combine them to end in heartache.
(EDIT: Or is this supposed to be heapsort, as opposed to a heap data structure? In that case, then, you should be looking at "what would a user want no matter what kind of a sort it is" which would probably be what should go in the base class. And I'm thinking the only thing the user needs is "sort()", so that would be your virtual function in the base class (and probably the only thing in the base class at all, unless you want to add a comparator function). The implementation details, like why you need a Type* in QSort, is specific to the implementation of that algorithm.)