


from __future__ import annotations

def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					dict			,     SCREAMING_SNAKE_CASE__			:					str				):
     __UpperCamelCase							,      __UpperCamelCase    							=set(SCREAMING_SNAKE_CASE__				), [start]

     while stack:
          __UpperCamelCase    							=stack.pop()
          explored.add(SCREAMING_SNAKE_CASE__				)
          # Differences from BFS:
          # 1) pop last element instead of first one
          # 2) add adjacent elements to stack without exploring them
          for adj in reversed(graph[v]				):
               if adj not in explored:
                    stack.append(SCREAMING_SNAKE_CASE__				)
     return explored


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

if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(depth_first_search(G, 'A'))









from numpy import exp, pi, sqrt

def 						_UpperCAmelCase				(			SCREAMING_SNAKE_CASE__			:					Tuple			,     SCREAMING_SNAKE_CASE__			:					float = 0.0			,     SCREAMING_SNAKE_CASE__			:					float = 1.0				):
     return 1 / sqrt(2 * pi * sigma**2				) * exp(-((x - mu) ** 2) / (2 * sigma**2)				)


if __name__ == "__main__":
   import doctest

   doctest.testmod()





