Greedy Algorithm and its applicaiton - rakeshsukla53/Hacker-Rank GitHub Wiki
Greedy Algorithm
Divide and Conquer Algorithm Paradigm ..you divide your problem into samller problems and ten solve it randomized algorithm (Quick sort algorithm) greedy algorithm which is basically used in the Dijkstra Algorithm dynamic programming
Greedy Algorithm
What is greedy Algorithm ?
A greedy algorithm is an algorithm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding a global optimum.
ITERATIVELY MAKE MYOPIC DECISION AND HOPE EVERYTHING WORKS OUT AT THE END
For example - Dijkstra's Algorithm (Taking myopic decisions)
1 - Easy to apply and easy to propose multiple greedy algorithm.
2 - Most greedy algorithm are not correct( Even if your intuition is saying otherwise)
3 - During our Djisktra Algorithm lecture we assumed that the edges has to be non negative otherwise D will not work properly.
Check out this pic https://www.pinterest.com/pin/429953095652410448/ ..it shows why the algorithm fails when one of the edges is negative.
#checkout the programs I have written for the greedy algorithm