Question: coukd you help implement this in python langauge thank you! Write a function adjacency_list(graph_str) that takes the textual representation of a graph (as a string)



coukd you help implement this in python langauge thank you!
Write a function adjacency_list(graph_str) that takes the textual representation of a graph (as a string) and returns its adjacency list. from pprint import pprint # undirected graph in the textbook example graph_string "" U 7 = 1 2 1 5 1 6 2 3 2 5 3 4 4 5 pprint(adjacency_list(graph_string)) [[l, [(2, None), (5, None), (6, None)], [(1, None), (3, None), (5, None)], [(2, None), (4, None)], [(3, None), (5, None)], [(1, None), (2, None), (4, None)], [(1, None)]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
