Q 9 If a graph containing n vertices and m edges, is represented using adjacency list structure, how much of memory will be required?
Ops: A
O O(n-m)
B.
O O(n+m)
C. O )
O O(n)
D. O O(n*m)
Answers
Answered by
0
Answer:
<section style="box-shadow:3px 5px 40px deeppink;background:black;">
<h1 style="color:deeppink;padding-left:120px;font-family:Times">
Answer
</h1>
<hr>
<p
hjjjjjjjj hjjjjjjjjjjjjjjj
Answered by
0
Answer:
The correct answer is option B
Explanation:
- A graph can also be represented using a linked list.
- For each vertex, a list of adjacent vertices is maintained using a linked list.
- It creates a separate linked list for each vertex Vi in the graph G = (V, E).
- Adjacency list of a graph with n nodes can be represented by an array of pointers.
- Each pointer points to a linked list of the corresponding vertex.
- Below figure shows the adjacency list representation of a graph.
Adjacency List Complexity
- Space: O(N + M)
- Check if there is an edge between nodes U and V: O(degree(V))
- Find all edges from a node V: O(degree(V))
Learn more about the information adjacency list structure
- https://brainly.in/question/2005364?referrer=searchResults
- https://brainly.in/question/23077105?referrer=searchResults
Attachments:
Similar questions