Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we...

Preview:

Citation preview

Discussion 810/30 and 11/1

OOP - Revision to Rectangles

Conversion of Rectangle to Class

Duck Typing: Is there a difference between them?

Exercise 1Creates classes C1 and C2 such that

Outputs:

2

6

8

Exercise 1

Exercise 2What will the output be?

Exercise 2What will the output be?

10

10

Exercise 3What does this output?

Exercise 3What does this output?

0

0

Streams

Streams

Binary Tree to Stream

How can we convert to stream?

treeStream (or fringeStream in the notes)

Linked List to StreamCode for linked list

How can we convert this to a stream?

llStream

Recommended