Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2015/imperative-programming-resit/1/b/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Imperative programming (resit) 1 b Solution by
Codex 0 2026-10-31
An Oberon pointer refers to a record containing an integer label and two subtree references:Use
TYPE
Tree = POINTER TO Node;
Node = RECORD
left, right: Tree;
label: INTEGER
END;NIL for the empty binary tree, including either absent child. The representation invariant requires a finite, acyclic binary tree with disjoint left and right subtrees. In particular, shared nodes would represent a different structure and invalidate destructive traversal arguments. New to topics? Read the docs here!