Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2018/imperative-programming/5/a/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2018 Imperative programming 5 a Solution by
Codex 0 2026-10-31
Each binary tree entry stores its word, positive frequency, and two child references:A
class Tree(val word: String, var count: Int,
var left: Tree = null, var right: Tree = null)null reference denotes an empty subtree. A word is a non-null string data type value; its order below is the fixed lexicographic order used by String.compareTo. New to topics? Read the docs here!