;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname a08interface) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #t)))
;;
;; *****************************************************************************
;;
;; Assignment 9 Interface File
;; CS 115, Spring 2019
;; Due: July 24th 10:00 AM
;;
;; *****************************************************************************
;;
;; q1
(define-struct snode (key left right))
;; a SNode is a (make-snode Num SSTree SSTree)
;; a simple search tree (SSTree) is either
;; * '() or
;; * a SNode, where keys in left are less than key, and in right greater
(define (build-balanced-tree L)
...)
;; q2
;; a leaf-labelled tree (LLT) is either
;; a Num or
;; a non-empty (listof LLT)
(define (llt-map fn T)
...)
;; q3
;; an Operator is a Str of length 1
;; more specifically, (anyof "+" "-" "*" "/")
(define-struct binode (op arg1 arg2))
;; a binary arithmetic expression internal node (BINode)
;; is a (make-binode Operator BinExp BinExp)
;; A binary arithmetic expression (BinExp) is either:
;; a Nat or
;; a BINode
(define (expand-binexp e)
...)
;; q4
(define-struct trien (label children))
;; a trie-node (TrieN) is a (make-trien Str (listof Trie))
;; a Trie is either:
;; a TrieN, or
;; a Str
(define z-trie (make-trien "z" (list (make-trien "a" (list "ny" "p"))
(make-trien "e" (list "al" "ro" "st"))
(make-trien "i" (list (make-trien "n" (list "c" "g"))
(make-trien "p" (list "" "s"))))
(make-trien "o" (list "ne" (make-trien "o" (list "" "m" "s")))))))
(define (list-words T)
...)