Summary CPSC 110 PSET 10 SOLUTION
;; On-ground students: Do the following as your pre-lab ;; Online students: Do the following as Task 1 ;; Using the data definitions below, design a function called can-encode? that ;; takes a letter (NOT an entire word) and a Huffman code tree and ;;produces true ;; if that letter is reachable in the given tree, false otherwise. You should ;; not use any accumulators. As a reminder, we have asked you to blend the ;; backtracking template into your design. ;; We have provided the signature, purpose, stub, and some tests. (@htdd HTree) (define-struct htree (zero one)) ;; HTree is one of ;; - String ;; - (make-htree HTree HTree) ;; interp. A Huffman code tree where ;; a string s is an encoded value ;; (make-htree z o) is a tree with zero-branch z and one-branch o (define HT0 "A") (define HTMAGIC (make-htree "A" (make-htree (make-htree "B" (make-htree "C" "D"))
Written for
- Institution
-
University Of Columbia
- Course
-
CPSC (CPSC110)
Document information
- Uploaded on
- November 26, 2022
- Number of pages
- 5
- Written in
- 2022/2023
- Type
- SUMMARY
Subjects
-
summary cpsc 110 pset 10 solution