Usage examples of greedy algorithms?

2019-03-11 05:45发布

What is the use of greedy algorithms? An real example?

8条回答
你好瞎i
2楼-- · 2019-03-11 06:00

Application of greedy method

Prim’s Algorithm , Kruskal Algorithm

查看更多
可以哭但决不认输i
3楼-- · 2019-03-11 06:07

Minimum Spanning Tree - Prim's algorithm and Kruskal's algorithm

Shortest Path Calculation - Dijkstra's algorithm

More: (Fractional Knapsack Problem, Huffman Coding, Optimal Merging, Topological Sort).

查看更多
甜甜的少女心
4楼-- · 2019-03-11 06:10

What is the use of greedy algorithms?

Greedy algorithms is choosing the best/optimal solution in each stage. Look at wikipedia article

An real example?

Minimum spanning tree algorithms are greedy algorithms

The famous Dijkstra's Algorithm is also greedy algorithm

查看更多
小情绪 Triste *
5楼-- · 2019-03-11 06:11

Anything where an optimal solution would be impossible - or very very hard.

Greedy algorithms take the best solution at the current point, even if that's not the best solution if you examined all aternatives

查看更多
Ridiculous、
6楼-- · 2019-03-11 06:18

I'm surprised no one pointed out huffman / shannon encoding ...

查看更多
登录 后发表回答