DOC PREVIEW
Berkeley COMPSCI 61A - Lecture 35

This preview shows page 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-234-235-236-237-238-239-240-241-242-243-244-245-246-247-248-249-250 out of 250 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 250 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

61A Lecture 35Monday, 28th November, 2011Monday, November 28, 2011Last time: sequential data and iterators2Monday, November 28, 2011Last time: sequential data and iteratorsSequences2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so far2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLength2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuples2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-front2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge data2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge datacan’t deal with infinite sequences2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge datacan’t deal with infinite sequencesIterators2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge datacan’t deal with infinite sequencesIteratorsStore how to compute elements2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge datacan’t deal with infinite sequencesIteratorsStore how to compute elementsCompute one element at a time2Monday, November 28, 2011Last time: sequential data and iteratorsSequencesThe sequence abstraction so farLengthElement selection•Lists and tuplesStore all elements up-frontcan’t deal with huge datacan’t deal with infinite sequencesIteratorsStore how to compute elementsCompute one element at a timeDelay evaluation2Monday, November 28, 2011Last time: sequential data and iterators3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is stored3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demand3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()for-loops rely on these methods3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()for-loops rely on these methodsGenerator functions3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()for-loops rely on these methodsGenerator functionsFunctions that use yield to output values3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()for-loops rely on these methodsGenerator functionsFunctions that use yield to output valuesCreates a generator object3Monday, November 28, 2011Last time: sequential data and iteratorsStreams -- a unit of delayed evaluation. 2 elements, first and rest.“first” is stored“compute_rest” is storedcalculate “rest” on demandNative python iterator interface__iter__()__next__()for-loops rely on these methodsGenerator functionsFunctions that use yield to output valuesCreates a generator object__iter__() and __next__() automatically defined3Monday, November 28, 2011Today: modularity, processing pipelines, and coroutinesModularity in programs so farHelper functions a.k.a “subroutines”Coroutines: what are they?Coroutines in pythonTypes of coroutinesMultitasking4Monday, November 28, 2011Modularity so far: helper functions5Monday,


View Full Document

Berkeley COMPSCI 61A - Lecture 35

Documents in this Course
Lecture 1

Lecture 1

68 pages

Midterm

Midterm

5 pages

Midterm

Midterm

6 pages

Lecture 14

Lecture 14

125 pages

Lecture 2

Lecture 2

159 pages

Lecture 6

Lecture 6

113 pages

Lecture 3

Lecture 3

162 pages

Homework

Homework

25 pages

Lecture 13

Lecture 13

117 pages

Lecture 29

Lecture 29

104 pages

Lecture 11

Lecture 11

173 pages

Lecture 7

Lecture 7

104 pages

Midterm

Midterm

6 pages

Midterm

Midterm

6 pages

Lecture 8

Lecture 8

108 pages

Lab 4

Lab 4

4 pages

Lecture 7

Lecture 7

52 pages

Lecture 20

Lecture 20

129 pages

Lecture 15

Lecture 15

132 pages

Lecture 9

Lecture 9

95 pages

Lecture 30

Lecture 30

108 pages

Lecture 17

Lecture 17

106 pages

Load more
Download Lecture 35
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 35 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 35 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?