Question
What is the difference between 'BFS' (Breadth-First
Search) and 'DFS' (Depth-First Search) in graph traversal?Solution
BFS (Queue-based): visits nodes level by level and guarantees shortest path in unweighted graphs. It is used in social networks (degrees of separation), GPS routing, peer-to-peer networks. DFS (Stack/Recursion): explores one path fully before backtracking and is used in topological sorting, detecting cycles, solving mazes, connected components. Time complexity: O(V+E) for both (V = vertices, E = edges). Memory: BFS stores entire frontier (can be large), DFS uses stack depth proportional to path length.
Under the PM VIKAS–IIT Palakkad skilling project, how many total candidates will be trained?
Which two countries will co-host the Women’s World Cup 2025 as per the ICC-UNICEF initiative?
Where was the second Global Conference on Air Pollution and Health 2025 held?
The share of workers in regular wage/salaried employment increased to what percentage in 2025?
World Fair Play Day originated from fair play initiatives launched in which city in 2013?
On which date is the International Day of Older Persons 2025 celebrated in Jabalpur, Madhya Pradesh by the Department of Social Justice & Empowerment?
- Sam Nujoma, who recently passed away, was the first president of which country?
Which organization partnered with SIDBI to facilitate loans to the MSME sector?
Which country was India’s biggest trading partner in the first half of 2021?
What is Lien Concept?