COMPSCI 61A Chapter Notes - Chapter 2.1-2.3: Rational Number, Raw Image Format, Data Structure

39 views3 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Integers (int), real numbers (float), complex numbers (complex: float values approximations to real values. Isolate parts of program that deal with: how data is represented, how data is manipulated, make as few assumptions about the data as possible, use functions to enforce an abstraction barrier between representation and use. 2. 2. 2 pairs: list literal, multiple assignment to unpack list. 2. 2. 3 abstraction barriers: violated when a part of a program that can use a higher level function instead uses a lower one that refers directly to specific data, not violating abstraction barriers makes programs more robust. If a pair p was constructed from x and y, the select(p, 0) returns x and select(p, y) returns y. 2. 3. 1 lists: sequence: ordered collection of values, list: sequence with any length, data structure, add lists together, multiply list makes list repeat. [x, y, z] list(_) a + b a[ : ] [list comprehensions] a += b a. append(_) a. extend(_) a. pop(_)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents