Sample Output

Below are three examples of running the program. Note that your program should produce the same output for the first two samples, but that there are multiple correct outputs for the third example.

Huffman Coding Preview ---------------------- This program creates a 'tree' that can be used to do a Huffman coding of text entered by the user. Program by Mark Young (A00000000) Press enter... Enter a line of text below: AAAAAAAAAAH!! Calculating Frequencies: (A, 10) (H, 1) (!, 2) Processing the Priority Queue: Combining (H, 1) and (!, 2) Combining ((H,!), 3) and (A, 10) Huffman 'tree': ((H,!),A)
Huffman Coding Preview ---------------------- This program creates a 'tree' that can be used to do a Huffman coding of text entered by the user. Program by Mark Young (A00000000) Press enter... Enter a line of text below: abccdddeeeeeffffffff Calculating Frequencies: (a, 1) (b, 1) (c, 2) (d, 3) (e, 5) (f, 8) Processing the Priority Queue: Combining (a, 1) and (b, 1) Combining (c, 2) and ((a,b), 2) Combining (d, 3) and ((c,(a,b)), 4) Combining (e, 5) and ((d,(c,(a,b))), 7) Combining (f, 8) and ((e,(d,(c,(a,b)))), 12) Huffman 'tree': (f,(e,(d,(c,(a,b)))))
Huffman Coding Preview ---------------------- This program creates a 'tree' that can be used to do a Huffman coding of text entered by the user. Program by Mark Young (A00000000) Press enter... Enter a line of text below: What noise annoys a noisy oyster? A noisy noise annoys a noisy oyster. Calculating Frequencies: (W, 1) (h, 1) (a, 5) (t, 3) ( , 12) (n, 9) (o, 9) (i, 5) (s, 9) (e, 4) (y, 7) (r, 2) (?, 1) (A, 1) (., 1) Processing the Priority Queue: Combining (W, 1) and (., 1) Combining (h, 1) and (?, 1) Combining (A, 1) and (r, 2) Combining ((h,?), 2) and ((W,.), 2) Combining (t, 3) and ((A,r), 3) Combining (e, 4) and (((h,?),(W,.)), 4) Combining (i, 5) and (a, 5) Combining ((t,(A,r)), 6) and (y, 7) Combining ((e,((h,?),(W,.))), 8) and (n, 9) Combining (s, 9) and (o, 9) Combining ((i,a), 10) and ( , 12) Combining (((t,(A,r)),y), 13) and (((e,((h,?),(W,.))),n), 17) Combining ((s,o), 18) and (((i,a), ), 22) Combining ((((t,(A,r)),y),((e,((h,?),(W,.))),n)), 30) and (((s,o),((i,a), )), 40) Huffman 'tree': ((((t,(A,r)),y),((e,((h,?),(W,.))),n)),((s,o),((i,a), )))