I have a min heap which consists of TreeNode*. I'm doing huffman coding to create a huffman binary tree from the minHeap. Everytime I pop, I need to set the root of the min heap to the TreeNode* that I'm returning to build the huffman tree. However, I realized I need a copy constructor or something of the sort to perform a deep copy so that I retain the same pointer information. So, my question is, how would I write a copy constructor that would work for TreeNode* if my TreeNode class looks as follows...
class TreeNode{
int ascii, frequency;
TreeNode *left, *right;