• +91 9723535972
  • info@interviewmaterial.com

CPlusPlus Interview Questions and Answers

Question - Write the psuedo code for the Depth first Search.

Answer - dfs(G, v) //OUTLINE Mark v as "discovered" For each vertex w such that edge vw is in G: If w is undiscovered: dfs(G, w); that is, explore vw, visit w, explore from there as much as possible, and backtrack from w to v. Otherwise: "Check" vw without visiting w. Mark v as "finished".

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners