Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2022/functional-programming-design-and-analysis-of-algorithms-resit/2/c/solution

The empty skew-binary random-access list contains no trees:
nil :: List a
nil = List []

null :: List a -> Bool
null (List []) = True
null _         = False
Both construction of nil and testing null take constant time.

New to topics? Read the docs here!