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.
Average of 10 observations calculated by a student was 60 but when he again went through his observations he realised that he took value of three observ...
- Rohit Sharma has an average score of 80 runs in 150 innings. The highest runs scored by him in an innings exceed his lowest score by 200 runs. If the runs ...
The average weight of 7 men decreases by 3 kg when one of them weighing 150 kg is replaced by another person. Find the weight of the new person
The average weight of 4 persons is 44 kg. The heaviest person’s weight is 30 kg more than the lightest person’s weight. If the average weight of the...
The average weight of 16 people increases by 500 grams when two individuals, each with an average weight of 40 kg, are added. What is the new average we...
Each side of a rhombus is 20cm long and the length of one of its diagonals is 24cm, then find the area of the rhombus.
The average height of the boys in a class is 160 cm, while the average height of the girls is 155 cm. The overall average height of all students in the ...

- Average of first 2 numbers is twice the average of next 4 numbers. If the average of all 6 numbers is 18, find the sum of the last 4 numbers.
- The average age of 15 team members was calculated to be 28 years. Later, it was found that one member’s age was taken as 35 instead of 25 and another’s...