Summary of the lecture week 4

Algorithms over trees and lists. A dictionary implementerad with a sorted open-ended binary tree. reverse, append, merge to keep lists sorted. Defining flatten on nested lists.

The accumulating parameter technique. append3. Considering the complexity. Using append3 to divide a list in three parts. Which is better ((app o app) o app)  or (app o (app o app))  (using o for relation composition)?

Difference lists. Implementing append for difference lists. Complexity. Consider similarities between using difference lists and the accumulating parameter technique.

Generalising an algorithm by defining separate clauses for representations and equality.

"abstract data types", keeping the represenation separated from the algorithm.