Help with adaptive Huffman theory question

This is a discussion on Help with adaptive Huffman theory question within the C++ Programming forums, part of the General Programming Boards category; The question from my homework is this: In the adaptive Huffman algorithm, first the codeword for an encountered symbol is ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    34

    Question Help with adaptive Huffman theory question

    The question from my homework is this:
    In the adaptive Huffman algorithm, first the codeword for an encountered symbol is issued and then the conversion table is updated. Could the table be updated first and then the new codeword for this symbol be issued? Why or why not?

    My thought process goes like this:
    Well, it seems to me that it can be done, but what would it save? The reason it could be done is because the table is simply a grouping of characters. As long as the rules are maintained how the table is updated will effect the code word.

    What I think they are suggesting is if the table looks like this:

    abcdef

    and the first letter in the message is a b, then to update the f would be moved to the front, first.

    fabcdef

    Then the codeword would be 001, and the tree would be made.

    My question is verification that my logic is correct or am I way off base here?

    Trista

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    34
    So nobody can help me with this?

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,581
    What would happen to the first character in the string. And the last?
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    34
    the last character would move to the first, the first character would move to the right. So it seems that it would only effect the code word made, making the code word longer, right?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  4. Theory question...
    By Imperito in forum C++ Programming
    Replies: 1
    Last Post: 01-01-2003, 05:58 AM
  5. CS Theory Question
    By edk in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2001, 01:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21