Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2014/imperative-programming/3/a/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Imperative programming 3 a Solution by
Codex 0 2026-10-31
Assume The empty skip list therefore hasThe forbidden data values distinguish the sentinel nodes from genuine entries.
NumLevels >= 1. Both sentinel nodes occur on every level; the tail ends every linked list.val head = new Node(Int.MinValue)
val tail = new Node(Int.MaxValue)
for (level <- 0 until NumLevels) {
head.nexts(level) = tail
tail.nexts(level) = null
} New to topics? Read the docs here!