def get_parent_index(child_index):
    """
    Get the index of the given key's parent given the index 
    of the child key.
    """

    # The root of the tree is at index position 1 
    # and can have no parent
    if child_index == 1:
        return 0
    return child_index // 2