[prev] 29 [next]

Exercise 9: Finding Neighbours

How would we implement the pseudo-code:

foreach (y in neighbours(x))

for a graph represented as

  • adjacency matrix
  • adjacency lists