Structural Induction
Recall the ADTs defined in the previous lab:
Tree
FIFO
Map
Prove the following properties are true, using structural induction:
1. $ \forall t\in \texttt{Tree}. size(t) \geq height(t)$
2. $ \forall t \in \texttt{Tree}. flatten(mirror(t)) = reverse(flatten(t))$
Find a proper formulation and prove the following properties:
1. Merging (using the strategy from Mergesort
) two sorted lists produces a sorted list.
2. A complete binary tree always has $ 2^{height(t)}-1$ nodes.