Question
Within the context of using bloom filters for spell checkers in Racket, I have everything (including the ctv function) set up except for the hash
Within the context of using bloom filters for spell checkers in Racket, I have everything (including the ctv function) set up except for the hash function. It's supposed to look like this:
key --> for each character c in w reading from right to left do key --> end for
where ctv ("character-to-value") maps `a' to 1, `b' to 2, ... and `z' to 26.
My current code does this reading from left to right:
(define key (lambda (w) if (null? w) 5187 (+ (* 29 (key(cdr w))) (ctv(car w)))) ))
I need to know how to do this from right to left.
So for example, if I do (key '(m a y))
i would get "y" then i will compute 5187 * 29 + 25 =150448
then get "a", compute 150448 * 29 + 1 = 4362993
and then get "m", computer 4362993 * 29 + 13 = 126526810?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started