If a Graph Structured Stack contains {1,2,3,4} {1,5,3,4} {1,6,7,4} and {8,9,7,4}, what would be the source and sink vertices of the DAC?

Category: QuestionsIf a Graph Structured Stack contains {1,2,3,4} {1,5,3,4} {1,6,7,4} and {8,9,7,4}, what would be the source and sink vertices of the DAC?
Editor">Editor Staff asked 1 month ago

If a Graph Structured Stack contains {1,2,3,4} {1,5,3,4} {1,6,7,4} and {8,9,7,4}, what would be the source and sink vertices of the DAC?
 
(a) Source – 1, 8 Sink – 7,4
 
(b) Source – 1 Sink – 8,4
 
(c) Source – 1, 8 Sink – 4
 
(d) Source – 4, Sink – 1,8
 
I’m obligated to ask this question of Incidence Matrix and Graph Structured Stack in chapter Graph of Data Structures & Algorithms I
 
The question was posed to me during a job interview.

1 Answers
Editor">Editor Staff answered 1 month ago

Right choice is (c) Source – 1, 8 Sink – 4
 
Explanation: Every Stack of the Graph Structured Stack represents a path, each path starts with the source vertex and ends with the sink vertex.