λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

University of California, Berkeley/ElectricalEngineering & ComputerSciences

(48)
Week 4 Week 4 Resources http://www.tmmydngyn.me/cs61a/guides/mutability.html Mutability and Nonlocal Intro This is a brief guide meant to serve as an extension to our discussion about mutability and nonlocal. Before continuing, be sure to have a good understanding of the difference between expressions and values and what a name is. Names Let’s briefly rev www.tmmydngyn.me https://docs.google.com/presen..
Mutable Sequences Mutable Sequences "Building Blocks" of programs - primitive expressions - arithmetic expressions - call expressions Managing complexity Representing collections of Data What are Containers good for ? : allow us to store related values together ( can process the values one-by-one or in aggregate ) ( allows us to form compound values through data abstraction ) : give rise to a number of ways of st..
LAB_day 5 Trees root, branch, leaf, leaves parent, child depth, height python codes ex. def tree ( label, branches = [] ) tree ( 1, [ tree(5), tree(2, [tree(3), tree(4), tree(7)])
Trees Sequence Aggregation Iterable : an object capable of returning its members one at a time several built-in functions take iterable arguments and aggregation them into a value : - sum ( iterable [, start] ) -> value - max ( iterable [, key = func ] ) -> value or max -> value More sequence aggregation - bool ( any_value ) -> bool : take in any value (not only iterables) and returns True if the valu..
Functional Decomposition & Debugging Program Decomposition - The process of breaking a large problem into more manageable sub-problems : It's often easier to write 4 250-line functions than 1 1000-line function - Goals of Program Decomposition : complexity management : reusability and abstraction The "Black Box" - A "black box" is opaque _ its inner workings are not revealed : data abstraction is an example of this : for constructo..
LAB_day 4 Sequences & Lists - sequence : an ordered collection of values - list : a sequence of values of any data type List Basics - lists are denoted by [] - features of lists: ( index ) : a position of an element in a list : starts from 0 goes to (length -1) :use list_name[index] to find the element in that index For loops - similar to while loops python codes ex. def while_print_list(lst): index = 0 w..
Sequence & Data Abstraction Sequences & Data abstraction Sequences : a sequence is an ordered collection of values - strings : sequence of characters - lists : sequence of values of any data type Sequence Abstraction : All sequences have finite length : Each element in a sequence has a discrete integer index : sequence share common behaviors based on the shared trait of having a finite length and indexed elements - Retriev..
Week 3 Week 3 resources https://docs.google.com/document/d/1S9rWGByjaN5VGRwW-UlFsJFSG5o7ZkCVony3mm4Tek0/edit Data Abstraction Data Abstraction Objectives: Understand the motivation for abstracting away functions and other information, apply the concept of data abstraction towards the solving of large problems, design modular programs. We will approach data abstraction from two di docs.google.com https:..