ASSIGNMENT 01
Develop a complete program that inputs a text file, and compresses it using Huffman algorithm.
Requirements
- Read a file input.txt
- Count frequency of all alphabets/symbols and store in frequency table
- Allocate TreeNodes from all symbols and their frequencies.
- Add all TreeNodes to MinPQ.
- Run the loop to construct Huffman Tree, until MinPQ returns only one element.
- Store last single element as Root.
- Find BINARY code of each alphabet from Huffman tree traversal and store in codes array.
- Using Huffman codes, compress the contents of input file.
- Write the compressed file output.txt
- Save the Huffman tree in another file codes.txt
- Using codes.txt, read the output.txt again and decompress it.
- Compare the original file and uncompressed file for any differences.
ASSIGNMENT 02
We know that all types of expressions and precedence cases cannot be handled by stack based postfix converter and evaluator.
· Develop an expression evaluator that parses an infix expression and generates a (Parse-Tree) Expression Tree.
The tree should also be visible on display.
· Develop an expression solver that traverses the expression tree and solves the expression.
Following cases should be handled.
1. Unary, Binary and ternary operators..
2. Multi-Character operators (++, = = , >=) etc
3. Float numbers
4. All types of brackets
5. Infix functions like sin(x), etc
6. All or most exceptional cases (that will be discussed in class and added in assignment later)
You received this message because you are subscribed to the Google Groups "Virtual University of Pakistan" group.
To post to this group, send email to discussion_vu@googlegroups.com.
To unsubscribe from this group, send email to discussion_vu+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/discussion_vu?hl=en.
No comments:
Post a Comment