Difference Lists Flashcards

1
Q

write append/3 for ordinary lists

A

169

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

What’s the time complexity of naive append? Explain why it performs copying.

A

171-172

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

What is the Prolog syntax for

1 :: ( 2 :: ( 3 :: A ) )

A

173

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

app/6 unsimplified version

A

174

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

Derive app/6 simplified

A

175-184

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

Explain the notation for difference lists

A

185-186

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

How should you write an empty difference list?

A

187

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

Explain the reason why empty diff lists are A-A by considering appending onto an empty list.

A

188

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