Hiya guys.
im after a bit of guidance to be honest
My task:
Create a program that generates huffman codewords for a 16 symbol alphabet, the input should be the probabilities of each symbol occurring.
Im gonna use 6 for ease of programming for now
Im unsure where to go... Ive created a basic "take user input - assign to an array" program.(userinput[])
Heres my thoughts.. copy userinput[] to huffmanarray[0,i] using a for loop, and bubble sort it
then take huffmanarray[0,6] add [0,5] (result)
then copy huffmanarray[0,i-2] to huffmanarray[1,i]
The put (result) into huffmanarray[1,5] and bubblesort again
rinse and repeat
This will create a huffman coding table in the array
Thats the only way i can think of doing it, but it seems terribly inefficient.
Ive seen some object orientated approaches programming the trees, and nodes, but i dont really understand how they do it. And i don't really have any experience with graphical programming (applets n suchlike)
(It is uni work, but as i say, I'm more after guidance as to how it can be done, id rather understand it and program it myself, rather that rip off someone else work)
any help would be greatly appreciated