Computer Science I / Heaps and Priority Management
Practice question · Select all that apply

Select every statement the lesson supports about binary heaps.

Hints
  1. One option promises an ordering the heap property does not actually impose.
  2. Ask whether the heap property says anything at all about two sibling nodes.
Show the answer
  • A. A heap can be stored in a plain array with no pointers
  • B. The extreme element is available at the root in O(1)
  • D. Insertion and removal are both O(log n)
  • E. In a max-heap every parent is at least as large as its children
Why

Constant-time access to the extreme, logarithmic updates, array storage and the parent-child relation are all stated. Full sorting is not: the property relates parents to children only, leaving siblings and cousins unordered, expecting a sorted sequence is the pitfall the lesson names, and getting one requires repeatedly removing the root.

Read the lesson: Heaps and Priority Management →

Practise Heaps and Priority Management

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Heaps and Priority Management