Skip to main content

Practice · 1 of 4

Heap Invariant Checker

CHALLENGE
Difficulty: advanced+25 XP

Implement bool heap_ok(const int *a, size_t n) verifying the max-heap invariant: every node >= its children. NULL with n>0 violates; n<=1 is trivially ok.

Back to lesson: Practice: Forensics Drills