     }
 
     var lengths: [HuffmanLength]
+    var treeRoot: HuffmanTreeNode
+    var reversedTreeRoot: HuffmanTreeNode
 
     var description: String {
         return self.lengths.reduce("HuffmanTable:\n") { $0.appending("\($1)\n") }

            self.lengths[index].symbol = symbol
            self.lengths[index].reversedSymbol = reverse(bits: loopBits, in: symbol)
        }
    }

    convenience init(lengthsToOrder: [Int]) {

//

import Foundation

class HuffmanTreeNode {
    let node: HuffmanLength?
    var left: HuffmanTreeNode? = nil
    var right: HuffmanTreeNode? = nil

    init(_ node: HuffmanLength? = nil) {
        self.node = node
    }
}

class HuffmanTable: CustomStringConvertible {

