Huffman树的一段代码,不知道哪里错了请指教
Huffman树的一段代码,修改过便于发贴
#include <stdio.h>#include <vector>using namespace std;struct HuffmanNode{ int weight; int isLeaf; struct HuffmanNode *parent; bool isUsed;};typedef struct HuffmanNode HNode;vector<HNode*> myQueue;int main(){; int weight=0; for(int i=0;i<5;i++){ HNode *hNode; hNode->weight=weight; hNode->isLeaf=true; hNode->isUsed=false; hNode->parent=NULL; myQueue.push_back(hNode); } printf("queue size:%d\n",myQueue.size()); return 0;}