tree - Scheme 2 minimum values for huffman BST -
Okay then say I was given a list of letters containing the letter, and its frequency - or the number of times that saw Was in a lesson in the former '((# \ A4.4) (# \ B. 2.) (# \ C.9)) How can I get 2 minimum frequencies so that I can add them to a tree? Is there any work that will help me find them?
Look at the section in the book, where you should apply the Huffman encoding tree with scratch. You will get full details in
About the question, there is a possible way to find two minimum frequencies in the list with the format specified here:
(define frequencies' (# A.4) (# \ b.2) (# \ c. 9)) Take (sorted by frequencies (lambda (xy) (CDR +) (CDR))) 2) = & Gt; '((# \ B. 2.) (# \ A4. 4))
Comments
Post a Comment