pt1是用来记录权值最小的结点的下标,ptl1应该是笔误,正确的是pt1。在循环中,如果找到了权值最小的结点,就将其下标赋值给pt1。

int min1 = 9999999;最小权值初值		for j = 0; j i; j++ 			if headerjparent != -1				continue;			parent!=-1说明该结点已存在哈夫曼			树中跳出循环重新选择新结点			if min1 headerjcount 				pt1 = j;				min1 = headerjcount;							header

原文地址: https://www.cveoy.top/t/topic/hNK2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录