
'''simple docstring'''
from __future__ import annotations

from collections.abc import Callable




def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__ = 100      ,    )   ->				Any:


		'''simple docstring'''


		snake_case   :    Dict			       =		x_start
		snake_case   :    List[str]			       =		fnc(UpperCamelCase__       )
		snake_case   :    Optional[Any]			       =		0.0

		for _ in range(UpperCamelCase__       ):
				# Approximates small segments of curve as linear and solve
				# for trapezoidal area
				snake_case   :    Union[str, Any]			       =		(x_end - x_start) / steps + xa
				snake_case   :    Dict			       =		fnc(UpperCamelCase__       )
				area += abs(fxa + fxa       ) * (xa - xa) / 2

				# Increment step
				snake_case   :    Union[str, Any]			       =		xa
				snake_case   :    Optional[Any]			       =		fxa
		return area


if __name__ == "__main__":




						def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__       )   ->				int:


								'''simple docstring'''


								return x**3

						print("f(x) = x^3")
						print("The area between the curve, x = -10, x = 10 and the x axis is:")
						lowercase__		    =	1_0
						while i <= 1_0_0_0_0_0:
												lowercase__		    =	trapezoidal_area(f, -5, 5, i)
												print(f"with {i} steps: {area}")
												i *= 1_0









from __future__ import annotations

from collections import deque
from queue import Queue
from timeit import timeit

_lowerCamelCase       =	{
    'A': ['B', 'C'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B'],
    'E': ['B', 'F'],
    'F': ['C', 'E'],
}






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							dict    ,      UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					{start}
		SCREAMING_SNAKE_CASE__								=					[start]
		SCREAMING_SNAKE_CASE__								=					Queue()
		queue.put(UpperCamelCase__			)
		while not queue.empty():
				SCREAMING_SNAKE_CASE__								=					queue.get()
				for w in graph[v]:
						if w not in explored:
								explored.add(UpperCamelCase__			)
								result.append(UpperCamelCase__			)
								queue.put(UpperCamelCase__			)
		return result






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							dict    ,      UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					{start}
		SCREAMING_SNAKE_CASE__								=					[start]
		SCREAMING_SNAKE_CASE__								=					deque([start]			)
		while queue:
				SCREAMING_SNAKE_CASE__								=					queue.popleft()
				for child in graph[v]:
						if child not in visited:
								visited.add(UpperCamelCase__			)
								result.append(UpperCamelCase__			)
								queue.append(UpperCamelCase__			)
		return result






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					f'''from __main__ import G, {name}'''
		SCREAMING_SNAKE_CASE__								=					10_000
		SCREAMING_SNAKE_CASE__								=					timeit(f'''{name}(G, \'A\')'''    ,      setup=UpperCamelCase__    ,      number=UpperCamelCase__			)
		print(f'''{name:<35} finished {number} runs in {res:.5f} seconds'''			)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	benchmark_function('breadth_first_search')
	benchmark_function('breadth_first_search_with_deque')
	# breadth_first_search                finished 10000 runs in 0.20999 seconds
	# breadth_first_search_with_deque     finished 10000 runs in 0.01421 seconds