CUET PG 2021 — Computer PYQ
CUET PG | Computer | 2021Which of the following ways can be used to represent a graph?
Choose the correct answer:
- A.
only Adjacency list
- B.
only adjacency Matrix
- C.
only incidence Matrix
- D.
All of the above
(Correct Answer)
All of the above
Explanation
Explanation
Maana ki hamare paas ek Graph G=(V,E) hai, jahan V vertices (nodes) ka set hai aur E edges ka set hai.
1. Adjacency Matrix
Yeh ek 2D array hota hai jiska size V×V hota hai. Agar vertex i aur j ke beech edge hai, toh value 1 hoti hai, warna 0.
A[i][j]={10amp;if edge (i,j) existsamp;otherwise
2. Adjacency List
Isme har vertex ke liye ek list (ya linked list) hoti hai jo usse jude saare padosi (neighbors) nodes ko store karti hai.
Adj[u]={v∈V∣(u,v)∈E}
3. Incidence Matrix
Yeh ek 2D array hota hai jiska size V×E hota hai. Yeh dikhata hai ki kaunsa edge kis vertex se juda hai.
I[v][e]={10amp;if edge e is incident on vertex vamp;otherwise

