Heap and Sorted File Implementation using Virtual Base class