[prev] 58 [next]

Exercise 14: Finding Neighbours

How would we implement the pseudo-code:

foreach (y in neighbours(x))

for a graph represented as

  • adjacency matrix
  • adjacency lists