1.

Which of these adjacency matrices represents a simple graph?(a) [ [1, 0, 0], [0, 1, 0], [0, 1, 1] ](b) [ [1, 1, 1], [1, 1, 1], [1, 1, 1] ](c) [ [0, 0, 1], [0, 0, 0], [0, 0, 1] ](d) [ [0, 0, 1], [1, 0, 1], [1, 0, 0] ]My enquiry is from Adjacency Matrix in portion Graph of Data Structures & Algorithms IThe question was posed to me in an international level competition.

Answer»

Correct ANSWER is (d) [ [0, 0, 1], [1, 0, 1], [1, 0, 0] ]

The EXPLANATION is: A SIMPLE graph MUST have no-self LOOPS, should be undirected.



Discussion

No Comment Found

Related InterviewSolutions