package huffman

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a htree =
  1. | Node of float * 'a htree * 'a htree
  2. | Leaf of float * 'a

Type for Huffman trees

type 'a t = 'a htree
val compare : 'a htree -> 'a0 htree -> int

Compare two huffman trees

  • parameter ht1

    a tree

  • parameter ht2

    a tree

val combine : 'a htree -> 'a0 htree -> 'a1 htree

Combine twho huffman trees

  • parameter ht1

    a tree

  • parameter ht2

    a tree

val sort : 'a htree list -> 'a htree list

Sort a list of huffman trees

  • parameter htl

    the list

val huffman : ('a * float) list -> 'b htree

Create a Huffman tree based on the description of an emitter

  • parameter l

    Symbol -> Frequency association

val dump_as_dot : string -> char htree -> unit

Outputs a tree to a dot file

  • parameter f

    The output file

  • parameter ht

    The Huffman tree

OCaml

Innovation. Community. Security.