
from collections.abc import Callable





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase    ,		__lowerCAmelCase							):
    snake_case__						=				a
    snake_case__						=				b
    if function(_lowerCamelCase							) == 0:  # one of the a or b is a root for the function
        return a
    elif function(_lowerCamelCase							) == 0:
        return b
    elif (
        function(_lowerCamelCase							) * function(_lowerCamelCase							) > 0
    ):  # if none of these are root and they are both positive or negative,
        # then this algorithm can't find the root
        raise ValueError("could not find root in given interval."							)
    else:
        snake_case__						=				start + (end - start) / 2.0
        while abs(start - mid							) > 10**-7:  # until precisely equals to 10^-7
            if function(_lowerCamelCase							) == 0:
                return mid
            elif function(_lowerCamelCase							) * function(_lowerCamelCase							) < 0:
                snake_case__						=				mid
            else:
                snake_case__						=				mid
            snake_case__						=				start + (end - start) / 2.0
        return mid





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    return x**3 - 2 * x - 5


if __name__ == "__main__":
     print(bisection(f, 1, 1_000))

     import doctest

     doctest.testmod()





# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase							):
    snake_case__						=				[False] * len(__lowerCAmelCase							)
    snake_case__						=				[-1] * len(__lowerCAmelCase							)

    def dfs(__lowerCAmelCase    ,		__lowerCAmelCase							):
        snake_case__						=				True
        snake_case__						=				c
        for u in graph[v]:
            if not visited[u]:
                dfs(__lowerCAmelCase    ,		1 - c							)

    for i in range(len(__lowerCAmelCase							)							):
        if not visited[i]:
            dfs(__lowerCAmelCase    ,		0							)

    for i in range(len(__lowerCAmelCase							)							):
        for j in graph[i]:
            if color[i] == color[j]:
                return False

    return True


# Adjacency list of graph
__magic_name__            =  {0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}





print(check_bipartite_dfs(graph))



