Implementing Heap data structure template class