This question is not worth extra credit and is entirely optional i. Tree Sets Video full 1pp 8pp Mutable Values Video full 1pp 8pp Function Examples Video full 1pp 8pp It should return a copy of the list, but with every occurrence of the old word replaced by the new word, even in sublists. See Lab 0 for more instructions on submitting assignments.

Week 10 Class Material. The Midterm 1 exam and solutions are posted. Week 10 Staff Resources. You will need to make the following changes:. Write a procedure substitute that takes three arguments: You will need to make the following changes:. Macros Video full 1pp 8pp

The solution is short fewer than 20 lines of codebut requires a clever idea.

CS61A Homework 11

Scale Stream Implement the function scale-streamwhich takes a stream s and a number kand returns a stream where each element is the corresponding element of s scaled by k. Implement has-cycle-constant with only constant space.

cs61a homework 11

Week 13 Staff Resources. It should return a cs661a of the first argument, but with each word that occurs in the second argument replaced by the corresponding word of the third argument: Week 8 Class Material. When you are done, submit with python3 ok –submit.

It is designed to challenge you to think creatively! Week 10 Class Material.


cs61a homework 11

Declarative Programming Video full 1pp 8pp Homewwork 3 Staff Resources. Using your solution to Q5, write substitute2 that takes a list, a list of old words, and a list of new words; the last two lists should be the same length.

Streams Video full 1pp 8pp Nonlocal and Object-Oriented Programming. More Scheme, Interpreters, Streams, and Macros.

In homeworks, we have three different categories of questions: Extra for Experts — As in earlier homeworks, these problems are completely optional. See Lab 0 for more instructions on submitting assignments. It is our hope that these categories will help guide you in deciding how to divide your time when working on the homeworks.

Homework 11 | CS 61A Fall

Write the predicate ordered? Week 16 Staff Resources.

cs61a homework 11

You will need to cs61x the following changes: Make sure to perform this operation even for items in sublists. You will need to make the following changes: Final Review Slides Exam Prep Allow a class to be created with an arbitrary number of base classes Classes should respond to a message ‘mro’ that returns the method resolution order for the class Looking up an attribute by name in a class using the ‘get’ message should follow the method resolution order Choose a method resolution order from the three approaches that have been used in Python since its invention.


CS 61A: Structure and Interpretation of Computer Programs

CS61A Homework 11 Due by Make sure to perform this operation even for homewlrk in sublists. Write the predicate ordered? Reinforcement Questions ho,ework Questions that we believe have material that is either covered by other questions in this homework or in past homeworks, and can therefore be considered second priority after the core questions have been completed.

Follow the instructions here to submit the electronic copy. Tail Recursion and Interpreters. That is, a stream may contain itself as part of the stream definition. Higher-Order Functions Video full 1pp 8pp Write the function deep-mapwhich takes a function and a deep homeowrk a list that might contain other lists and returns a copy of the deep list with all items replaced with the result of applying fn onto each item.