



def 							A     (						__UpperCAmelCase				,   __UpperCAmelCase      )			->			int:



						'''simple docstring'''






						for index, item in enumerate(__UpperCAmelCase      ):
												if item == target:
																		return index
						return -1







def 							A     (						__UpperCAmelCase				,   __UpperCAmelCase				,   __UpperCAmelCase				,   __UpperCAmelCase      )			->			int:



						'''simple docstring'''






						if not (0 <= high < len(__UpperCAmelCase      ) and 0 <= low < len(__UpperCAmelCase      )):
												raise Exception('''Invalid upper or lower bound!'''      )
						if high < low:
												return -1
						if sequence[low] == target:
												return low
						if sequence[high] == target:
												return high
						return rec_linear_search(__UpperCAmelCase				,   low + 1				,   high - 1				,   __UpperCAmelCase      )


if __name__ == "__main__":
							UpperCamelCase_      			=  input("Enter numbers separated by comma:\n").strip()
							UpperCamelCase_      			=  [int(item.strip()) for item in user_input.split(",")]

							UpperCamelCase_      			=  int(input("Enter a single number to be found in the list:\n").strip())
							UpperCamelCase_      			=  linear_search(sequence, target)
							if result != -1:
														print(f"linear_search({sequence}, {target}) = {result}")
							else:
														print(f"{target} was not found in {sequence}")










def 							A     (						__UpperCAmelCase				,   __UpperCAmelCase      )			->			int:



						'''simple docstring'''






						print('''\nVertex Distance'''      )
						for i in range(__UpperCAmelCase      ):
												if dist[i] != float('''inf'''      ):
																		print(__UpperCAmelCase				,   '''\t'''				,   int(dist[i]      )				,   end='''\t'''      )
												else:
																		print(__UpperCAmelCase				,   '''\t'''				,   '''INF'''				,   end='''\t'''      )
												print()







def 							A     (						__UpperCAmelCase				,   __UpperCAmelCase				,   __UpperCAmelCase      )			->			str:



						'''simple docstring'''






						UpperCAmelCase_					=	float('''inf'''      )
						UpperCAmelCase_					=	-1
						for i in range(__UpperCAmelCase      ):
												if (not vset[i]) and mdist[i] < min_val:
																		UpperCAmelCase_					=	i
																		UpperCAmelCase_					=	mdist[i]
						return min_ind







def 							A     (						__UpperCAmelCase				,   __UpperCAmelCase				,   __UpperCAmelCase      )			->			Optional[Any]:



						'''simple docstring'''






						UpperCAmelCase_					=	[float('''inf'''      ) for _ in range(__UpperCAmelCase      )]
						UpperCAmelCase_					=	[False for _ in range(__UpperCAmelCase      )]
						UpperCAmelCase_					=	0.0

						for _ in range(v - 1      ):
												UpperCAmelCase_					=	min_dist(__UpperCAmelCase				,   __UpperCAmelCase				,   __UpperCAmelCase      )
												UpperCAmelCase_					=	True

												for i in range(__UpperCAmelCase      ):
																		if (
																		    (not vset[i])
																		    and graph[u][i] != float('''inf'''      )
																		    and mdist[u] + graph[u][i] < mdist[i]
																		):
																								UpperCAmelCase_					=	mdist[u] + graph[u][i]

						print_dist(__UpperCAmelCase				,   __UpperCAmelCase      )


if __name__ == "__main__":
							UpperCamelCase_      			=  int(input("Enter number of vertices: ").strip())
							UpperCamelCase_      			=  int(input("Enter number of edges: ").strip())

							UpperCamelCase_      			=  [[float("inf") for i in range(V)] for j in range(V)]

							for i in range(V):
														UpperCamelCase_      			=  0.0

							for i in range(E):
														print("\nEdge ", i + 1)
														UpperCamelCase_      			=  int(input("Enter source:").strip())
														UpperCamelCase_      			=  int(input("Enter destination:").strip())
														UpperCamelCase_      			=  float(input("Enter weight:").strip())
														UpperCamelCase_      			=  weight

							UpperCamelCase_      			=  int(input("\nEnter shortest path source:").strip())
							dijkstra(graph, V, gsrc)





