AMD Interview Question

write code for different types of implementation of the graph.