Simplified the Haskell min2 function, and simplified the C++ swap function in Huffman coding