Blockly Lists & Iteration CT @ VT Things we are seeing Using - - PowerPoint PPT Presentation
Blockly Lists & Iteration CT @ VT Things we are seeing Using - - PowerPoint PPT Presentation
Introduction to Computational Thinking Blockly Lists & Iteration CT @ VT Things we are seeing Using lists to represent a data stream Blockly blocks for iteration Using iteration to process a data stream (i.e., a list)
CT@VT Things we are seeing Using lists to represent a data stream Blockly blocks for iteration Using iteration to process a data stream
(i.e., a list)
Different patterns for processing a data
stream
Uniform Accumulate Filter Transform
Slide 2 Spring 201 2015
CT@VT Patterns
Uniform: perform the same processing
- n each element of the list
Accumulate: determine a property of the
list
Filter: use a decision to select some
elements of the list for processing
Transform: produce a new list by
processing the elements of an existing list
Slide 3 Spring 201 2015
CT@VT Thinking about iteration
Slide 4 Spring 201 2015
middle start end
CT@VT Accumulate pattern
Slide 5 Spring 201 2015
property property middle
CT@VT Finding the total
Slide 6 Spring 201 2015
32 34 middle 4 14 9 2 15 7 10 10 7 15 2 9 14 4
CT@VT Finding the total
Slide 7 Spring 201 2015
beginning 4 14 9 2 15 7 10 61 end 4 14 9 2 15 7 10
CT@VT Filter pattern Motivation: in big data only certain
- ccurrences may be of interest
Big earthquakes Temperatures above or below a certain
threshold
A high or low crime rate
Mechanism: combine
iteration – to provide each element one at a time decision - process each element that passes the
test
Slide 8 Spring 201 2015
CT@VT Filter pattern
Slide 9 Spring 201 2015
false Basic step Test A true Process A A
CT@VT Next steps today Work on the assigned Blockly and list
problems in the book using iteration and decision
Work as an individual Seek help from and provide help to your cohort
Go as far and as fast as you can
remembering to keep everyone in your cohort on board
Cohort feedback/reports Start looking at data streams (7.4-7.6 in the
book)
Slide 10 Spring 201 2015