Which data structure is used to represent a graph?
20 views
- List (Correct Answer)
- Stack
- Queue
- Tree
Explanation
Answer: a) List
Explanation: A graph is typically represented as a list of vertices and a list of edges connecting the vertices. The vertices can be stored in an array or a linked list, while the edges can be stored in a separate list or as part of the vertex structure.