哈夫曼编码 (Swift实现) func huffmanCode(_ &p: Node, _ numsLeafs: Int, _ &codes: String) { //p为节点数组的指针,codes为string数组的指针