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.
Select the correct option that indicates the arrangement of the following words in a logical and meaningful order.
1. Lung
2. Kidney
<...Three of the following words are alike in some manner and hence form a group. Which word does NOT belong to that group? (The words must be considered as...
Rohan started from his home towards the east, and after walking for 5 m, turned left. From there, after walking for 15 m, he turned right and walked for...
Select the set of classes the relationship among which is best illustrated by the following Venn diagram.
Statements:
All teas are juices.
All juices are cocktails.
Conclusions:
I. All teas are cocktails.
II. All cockta...
Select the triad which following the same pattern as that followed by the two triads given below. Both triads follow the same pattern.
EV – GT ...
Six colleagues, Ranjana, Diksha, Chahat, Aakash, Rita and Suraj, are sitting on a bench in a pack facing north. Rita is sitting at the east end of the b...
Select the set in which the numbers are related in the same way as are the numbers of the following sets.
(NOTE: Operations should be performed o...
What should come in place of ? in the given series?
41 45 54 70 95 ?
Four words have been given, out of which three are alike in some manner and one is different. Select the one that is different.