Aggregation Video full 1pp 8pp Inheritance Video full 1pp 8pp Ordered Sets Video full 1pp 8pp Week 15 Staff Resources. Week 1 Staff Resources. Week 8 Staff Resources.
You will need to make the following changes:. Iterators Video full 1pp 8pp Midterm 2 , solutions , and walkthrough videos are posted. Linked Lists and Midterm Review. Databases Video full 1pp 8pp Data Examples Video full 1pp 8pp
CS61A Homework 11
The solution is short fewer than 20 lines of codebut requires a clever idea. 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.
Extra for Experts — As in earlier homeworks, these problems are completely optional. Use Ok to test your code: Tail Recursion and Interpreters.
Is it always possible to correctly return f? You might find the following references useful:. 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.
That is, a stream may contain itself as part of the stream definition. However, these are questions that we consider either more difficult than what we would ask you on an exam or that focus on ideas we are not concerned with in this course, so please do not be discouraged if you do not solve them.
Week 6 Class Material. Define a function find which takes in as input a stream and a predicate, and returns the first element in the stream satisfying the predicate.
CS 61A: Structure and Interpretation of Computer Programs
The Scheme template file, hw Containers Video full 1pp 8pp Week 16 Class Material. Week 1 Staff Resources. Streams Video full 1pp 8pp Your solution should work even if s has an infinite number of items.
We do not require a paper copy. Every student should have signed up for a discussion and lab section.
The code for the OOP implementation can be found in oop. Extra for Experts — As in earlier homeworks, these problems are completely optional. Control Video full 1pp 8pp Final Review Slides Exam Prep This question is not worth extra credit and is entirely optional i.
Write the predicate ordered? Write the function deep-mapwhich takes a function and a deep list a list that might contain other lists and returns a copy of the deep list with all items replaced with css61a result of applying fn onto each item. The code for the OOP implementation shown in class can be found in oop. It should return a copy of the first argument, but with each word that occurs in the second argument replaced by the corresponding word of the third argument:.
Homework 11 | CS 61A Fall
Week 3 Class Material. If you would like a reader to give you written feedback on your homework, submit a paper copy to the homework box. Week 14 Staff Resources. Objects Video full 1pp 8pp Tree Sets Video full 1pp 8pp Week 7 Class Material.
Week 15 Class Material. If you would like, you can use the template files hw