How can I use arrays in Scheme?
In particular, I’m attempting to implement a recursive fibonacci procedure using memoization. Do arrays even exist in Scheme?
If not, how can I implement memoization?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are arrays in Scheme, but they are called vectors. Be aware that they don’t resize like they do in other languages like Perl and Javascript, or the like-named C++ thing; you have to make a bigger one and copy the contents of the obsolete one over.
If you want to know more about memoization and dynamic programming in particular, you can read chapter 12 of the free book Concrete Abstractions.