def get_parent(index: int) -> int:
    """Returns the parent of the heap node

    For a heap array, this function returns the address of the parent node

    Parameters
    ----------
    index : int
        Child node to get the parent of

    Returns
    -------
    int
        Address of the parent node, or the node itself if there is only one node
    """
    if index == 0:
        return 0
    elif index % 2 == 0:
        return int((index - 2) / 2)
    else:
        return int((index - 1) / 2)