def parent_index(self, child_idx: int) -> int | None:
        return the left child index if the left child exists.
        if not, return None.
        return the right child index if the right child exists.
        if not, return None.
        correct a single violation of the heap property in a subtree's root.
        self.h = list(collection)
        self.heap_size = len(self.h)
        if self.heap_size > 1:
            # max_heapify from right to left but exclude leaves (last level)
            for i in range(self.heap_size // 2 - 1, -1, -1):
                self.max_heapify(i)