Module 9: Recursion and Fractals Flashcards

1
Q

_________ is any thing that refers to itself.

A

recursion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A ________ is a thing that has self-similar copies of itself in itself.

A

fractal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The drawing tool used to draw fractals is _________.

A

ipycanvas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A __________ is a square fractal that is divided into 9 smaller squares: the middle is simply filled in and each of the outer squares is a smaller ___________ of depth one less.

A

sierpinski carpet
sierpinski carpet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A node with ________ is a leaf.

A

no children

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A ________ stores some information on each node.

A

label

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A __________ is a special kind of tree that only has labels on the leaves. If no label, a node is storing only a list of _________.

A

leaf-labelled tree
more trees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define an LLT as ____________.

A

LLT = int | list[‘LLT’]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Need to treat differently the different ‘kinds’ of LLT. Write int kind as ____________. Write list kind as _____________.

A

if isinstance(t, int): …
if isinstance(t, list): …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

To rewrite code using while so it uses recursion instead:
1. add a ___________ for each local variable; set initial value in call.
2. replace the while with ______.
3. return the value from a recursive call with ________________.
4. in the else, return the answer based on the __________.

A

parameter
if
updated parameters
parameter values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A _______ function is a function that does some small setup before calling another function that does the main work.

A

wrapper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly