From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA25496 for caml-redistribution; Mon, 8 Sep 1997 09:02:19 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA19616 for ; Fri, 5 Sep 1997 23:50:56 +0200 (MET DST) Received: from perseus.bancosantander.es ([195.53.80.2]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id XAA27558 for ; Fri, 5 Sep 1997 23:50:51 +0200 (MET DST) Received: from default ([195.53.80.180]) by perseus.bancosantander.es (Netscape Mail Server v1.1) with ESMTP id AAA2450 for ; Fri, 5 Sep 1997 23:45:53 +0100 Reply-To: From: "Isidro Jimenez Ovelar" To: Subject: huffman compresion Date: Fri, 5 Sep 1997 23:49:30 +0200 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <19970905224552.AAA2450@default> Sender: weis I am new in this group, I am a student of informatic at Politecnica of Madrid University. I have to use caml to make a practice and I 'd be very pleased if someone of you could help a little bit. This the job: Huffman compression The functions I have to do are: Frecuency1: (* File -> (int ,float) Tabla *) (* this function read a file in binary mode and give one table with the frecuencies of each simbol *) Maketree: (* (`symbol , float) Table -> `symbol list -> symbol Huftree (* This function take the table of relatives frecuencies and the list of symbols of the file and gives a Huffman tree *) Compress (* int Hufftree -> file -> file -> unit *) ¦ ¦ (* This function takes the name of a file to compress and the compressed ¦ filed and inteprets the data byte to byte *) ¦ ¦ UnCompress (*int Hufftree -> File -> File -> unit *) ¦ (*This function makes the opposite of Compress*) ¦ ¦ I use these types: ¦ ¦ ¦ ¦type 'symbol Huftree = ¦ ¦ Hoja of 'symbol ¦ |final ¦ |Nodo of 'symbol Huftree * 'symbol Huftree;; ¦ ¦type file == string;; ¦ ¦ ¦ I have some problems to make the Huffman tree and the compress and ¦ uncompress functions. If someone have done something similar or have ¦ any ideas to help me I would be very grateful. ¦ ¦ Thanks for all. ¦ ¦ ¦