✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
In Section 1 of the lab, graph G is represented using an adjacency dictionary. Exercise 1 asks you to add a new vertex "X" that is adjacent to both "A" and "F", updating all endpoints[cite: 4].
Which Python snippet correctly performs this update without breaking the undirected graph invariant?