--- a/Exercises/ex12/ex12.thy Fri Jul 07 21:00:57 2017 +0200
+++ b/Exercises/ex12/ex12.thy Sat Jul 08 19:03:42 2017 +0200
@@ -24,6 +24,9 @@
fun deq :: "'a queue \<Rightarrow> 'a queue" where
"deq (xs,ys) = balance (xs, tl ys)"
+text \<open>Note that we assume that the size computation in \<open>balance\<close> only takes constant time.
+In reality the time is linear. How would you avoid that?\<close>
+
fun t_enq :: "'a \<Rightarrow> 'a queue \<Rightarrow> nat" where
"t_enq a (xs,ys) = 1 + (if size xs + 1 \<le> size ys then 0 else size xs + 1 + size ys)"