Suppose you want to represent graphs where the number of nodes is unknown in advance, and the nodes IDs are arbitrary (not contiguous).
You want the following operations to be performed efficiently:
Add a node.
Remove a node.
Add an edge.
Remove an edge.
Find the degree of a node.
Find all neighbours of a node.
Describe your data structure and give the performance of each of the above operations.