COMPSCI 61A Lecture 11: Lecture 11 (9/20/17)
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
Reason for notation, sequential data is complicated. A method for combining data values satisfies the closure property if: The result of combination can itself be combined using the same method. Closure is powerful b/c it permits us to create hierarchical structures. Hierarchical structures are made up of parts, which themselves are made up of parts, and so on. Useful for representing many things in the world. Need a way to keep track of what"s inside of what. Lists are represented as a row of index-labeled adjacent boxes, one per element. Each box either contains a primitive value or points to a compound value. Odds = [3, 5, 7, 8, 11] This is one way to get stuff. Odds [:3] goes up to index 3. Several built in functions take iterable arguments and aggregate them into a value. [] + [2 , 3] returns a list. Max(a, b, c [, key=func]) value.