Graph Algorithm 16

0. Consider an undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r. Let d(r, u) and d(r, v) be the lengths of the shortest paths from r to u and v respectively in G. If u is visited before v during the breadth first traversal, which of the following statement is correct?

  • Option : C
  • Explanation :
    d(r, v) and d(r, v) will be equal when u and v are at same level, otherwise d (r, v) will be less than d(r, v)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *