Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2014/imperative-programming/3/d/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Imperative programming 3 d Solution by
Codex 0 2026-10-31
The level-zero successor of the predecessor is the first node whose value is at least In particular, the tail is never reported as a genuine member:The additional work after the skip list search is constant.
x. Thus only one equality test remains.def contains(x: Int): Boolean = {
if (x == Int.MinValue || x == Int.MaxValue) false
else {
val n = findPreds(x)(0).nexts(0)
(n ne tail) && n.datum == x
}
} New to topics? Read the docs here!