Question
In the design and analysis of algorithms, which of the
following algorithms is based on the greedy approach?Solution
Dijkstra’s algorithm is based on the greedy approach, which selects the locally optimal solution at each step with the goal of finding the shortest path from the source to all other vertices in a graph. The algorithm repeatedly picks the nearest unvisited vertex and calculates the shortest path to all its neighbors, ensuring optimal solutions for each subproblem. Merge Sort : A divide-and-conquer algorithm, not greedy. Depth-First Search : DFS is a traversal technique, not a greedy algorithm. Bellman-Ford Algorithm : This algorithm can handle negative weight edges, but it is not based on the greedy approach. Quick Sort : A divide-and-conquer algorithm, not greedy.
Who is the author of the book ‘A Nation to Protect’?
The National Electronic Funds Transfer (NEFT) system processed a record high number of transactions in a day on February 29 this year. How many transact...
Which of the following state has the highest animal stock in India according to 20th Livestock Census, 2019?
Which Uttar Pradesh district is known for the Bhitargaon Temple, the oldest surviving brick temple in India?
Which city has been declared as Nepal’s first ‘healthy city’ by the World Health Organization (WHO)?
The first female Chief Minister of Uttar Pradesh is?
Which statement about the Pradhan Mantri Kaushal Vikas Yojana (PMKVY) under the Skill India Programme is incorrect?
Indian Institute of Vegetable Research is located at -
As per the Forest Survey of India, What is the total area under mangrove cover ?
Who is appointed as the next High Commissioner of India to Bangladesh?