Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2014/functional-programming-design-and-analysis-of-algorithms/7/a/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Functional programming, design and analysis of algorithms 7 a Solution by
Codex 0 2026-10-31
A maximum priority queue is an abstract data type holding items with comparable priority keys and giving access to a greatest-key item. Equal priorities may occur; any one of the tied maximum items can be returned unless a tie rule is specified.
emptyor initialization creates a queue with no items;isEmptyandsizeinspect its occupancy.insert(item, key)adds an item with its priority.maximum()returns a greatest-priority item without removing it.extractMax()returns and removes a greatest-priority item.- When mutable priorities are supported,
increaseKey(handle, newKey)raises an existing item's priority; the handle identifies its stored location.
New to topics? Read the docs here!