Thread: The Huffman Algorithm

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    903

    The Huffman Algorithm

    Hey. In a project I am working on I need to use the Huffman algorithm (or any good and not-too-hard-to-implement compression algorithm for that matter) and I can't figure out quite well how to put it into code. I have read on both Wikipedia and the official Huffman website but I still can't figure out a way to do it. I have also read a separate article on binary heap but it wasn't of much help either.

    Could anyone explain me a way to achieve this, without giving me any code (or not too much). I'm very stubborn and pig-headed and don't want to rely on other people's code because then I feel I have no credit for what I have done.

    Thanks to all.

    http://www.huffmancoding.com/david/algorithm.html
    http://en.wikipedia.org/wiki/Huffman_coding

  2. #2

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    903
    Thanks. I think I've found a way that could work. I'll keep you guys informed if I finish it. I should have it done by sunday (meh, work in-between).

  4. #4
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    Depending on what your compressing, Lempel-Ziv is a good
    algorithm that's used in compressing large files whose symbol
    alphabet isn't particularly easy to frequency analyse - i.e.
    executables. Here's what Wikipedia has on the subject

    I imagine that it'd be easier to implement than Huffman too.
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Implement of a Fast Time Series Evaluation Algorithm
    By BiGreat in forum C Programming
    Replies: 7
    Last Post: 12-04-2007, 02:30 AM
  2. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM