

def    __UpperCAmelCase (	__a      :			dict	)			->     bool:

					"""simple docstring"""

					_a	:    set[int]         =		set()
					# To detect a back edge, keep track of vertices currently in the recursion stack
					_a	:    set[int]         =		set()
					return any(
					    node not in visited and depth_first_search(__a		,__a		,__a		,__a	)
					    for node in graph	)



def    __UpperCAmelCase (	__a      :			dict		,__a      :			int		,__a      :			set		,__a      :			set	)			->     bool:

					"""simple docstring"""

					visited.add(__a	)
					rec_stk.add(__a	)

					for node in graph[vertex]:
										if node not in visited:
															if depth_first_search(__a		,__a		,__a		,__a	):
																				return True
										elif node in rec_stk:
															return True

    # The node needs to be removed from recursion stack before function ends
					rec_stk.remove(__a	)
					return False


if __name__ == "__main__":
			from doctest import testmod

			testmod()






def    __UpperCAmelCase (	__a      :			float	)			->     float:

					"""simple docstring"""

					return 10 - x * x



def    __UpperCAmelCase (	__a      :			float		,__a      :			float	)			->     float:

					"""simple docstring"""

					if equation(__a	) * equation(__a	) >= 0:
										raise ValueError('''Wrong space!'''	)

					_a	:    Dict         =		a
					while (b - a) >= 0.01:
										# Find middle point
										_a	:    Any         =		(a + b) / 2
										# Check if middle point is root
										if equation(__a	) == 0.0:
															break
										# Decide the side to repeat the steps
										if equation(__a	) * equation(__a	) < 0:
															_a	:    str         =		c
										else:
															_a	:    Union[str, Any]         =		c
					return c


if __name__ == "__main__":
			import doctest

			doctest.testmod()

			print(bisection(-2, 5))
			print(bisection(0, 6))



