Complete the sentence to describe a min-heap property.
In a min-heap, the value of each parent node is [1] than or equal to the values of its children.
In a min-heap, each parent node's value is less than or equal to its children's values, ensuring the smallest value is at the root.
Complete the sentence to describe a max-heap property.
In a max-heap, the value of each parent node is [1] than or equal to the values of its children.
In a max-heap, each parent node's value is greater than or equal to its children's values, so the largest value is at the root.
Fix the error in the statement about heap structure.
A heap is a [1] tree where each level is completely filled except possibly the last, which is filled from left to right.
A heap is a binary tree with a specific shape property: all levels are fully filled except possibly the last, which fills from left to right.
Fill both blanks to complete the min-heap property check in code.
if node_value [1] child_value and node_value [2] sibling_value: # This satisfies min-heap property
In a min-heap, the parent node's value must be less than or equal to both children's values to maintain the heap property.
Fill all three blanks to complete the max-heap property check in code.
if parent_value [1] child1_value and parent_value [2] child2_value and is_complete_binary_tree [3] True: # This is a valid max-heap
For a max-heap, the parent value must be greater than or equal to both children, and the tree must be a complete binary tree (checked by equality).