ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Solutions.P50

Description

Some solutions to Problems.P50 of Ninety-Nine Haskell Problems.

Synopsis

Documentation

huffman :: [(Char, Int)] -> [(Char, String)] Source #

Given a list of symbols and their number of occurrences, construct a list of the symbols and their Huffman encoding.

The characters '0' and '1' will represent the 0 and 1 bits in the encoding.