Draw a graph and illustrate how depth-first search and breadth-first search differ
This was the first question in Computer Officer Examination in 2010 conducted by Public Service Commission (Lok Sewa Aayog). This question is from the section ‘Data Structures and Algorithms’. The question carries 10 marks. Answer Breadth-first search (BFS) and depth-first search (DFS) are the two algorithms used for traversing and searching a node in a [...]