Hi everyone, I got confused from these last mails. Kerry wrote my, my, ... and Sean wrote no, no, ..
I went back to look at the original request. My interpretations are included. Huffman [Codes] : .............. Name of the HOMEWORK assignment. // Create an application that lets you select a text file as input. 1- Create a button, when clicked show the open file dialog that just read text files (*.txt). // Read that selected file to your program's memory. Since the file is // a text file your input is composed of ASCII characters. You don't // have to calculate these numbers. ASCII codes are numbers. 2- Read the opened text file and calculates the numbers of each characters and total characters used in it. // Huffman codes are used to compress your text. I wonder if you had // in this "result" to show what is the size of your original source // file. If that is it, than "total characters" is probably the number // of received characters. 3- Show the result in an info message box. // When you need to evaluate the Huffman codes you must know the // character (or other sized string) distribution function of your // input file. This is a nice place to calculate this function. // Once you get the required information you can evaluate what should // be your string substition sequences (thus creating your huffman // function, see question #8). 4- In order to the numbers of each used character, and Huffman algorithm make the Huffman codes. // The compressed file is not necessarily a text file, it can become a // binary file. 5- Read the text file again, and using the Huffman codes that produced in part 4, encode the text file and create a __text__ file that includes the coded data (Compression file). // Once you have the compressed file you can compare its size to the // original "total.." and from this to evaluate your comprassion rate. 6- Calculate the "compression rate". "compression rate" is the numbers of the bits used in the coded file (compressed file) divide to the numbers of the bits in the original text file (file before coding) // I guess that here you are requested to decode your encoded file // and to show that you can recover back your original file. 7- Program can encode the coded file to the original file. // You are adviced to measure this using system functions on very // large text files, this will ensure that you get non zero results. 8- Show the program time (time that used for coding file to compressed file) and show the Huffman tree. // The "big-oh" is probably the Order of your program. A nice way // to evaluate this is to get some files which are a multiplication // of ones size (e.g. sizeof(file1)=N, sizeof(file2)=2N,... // sizeof(file5)=10N). Find out if your execution time is linear // proportional with the file size or otherwise. 9- Calculate big-oh of program. And still it looks like homework and you have shown nothing that you did until now. Moshe. --- In [email protected], Sean Brewer <[EMAIL PROTECTED]> wrote: > > Kerry Thompson wrote: > > Let me guess. Your professor (or teacher) is named Huffman. My, my, my. Kids > > these days. You don't even pretend you're not cheating. > > > > Kiddo, we ain't doin' your homework for you. Go back, do some of your own > > work (you'll actually learn something that way), then come back when you've > > got a specific question. > > > > Cordially, > > > > Kerry Thompson > > > No no no. The huffman he's referring to is *huffman coding* which is > used for lossless data compression, specifically I think, used in the > compression algorithms for ZIP, JPEG, and MPEG. > > http://en.wikipedia.org/wiki/Huffman_coding > > > > > He supposedly understands *how* to implement the particular algorithm to > compress his text files (or maybe he already has the code for it or > whatever), but not how to do the UI stuff, which really should be waay > easier than implementing the algorithm. > To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/c-prog/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
