What is the use of greedy algorithms? An real example?
A real life example of Greedy Algorithm will be Interval Scheduling.
For example if you want to maximize the number of customers that can use a meeting room, you can use Interval Scheduling Algorithm.
Application of greedy method
Prim’s Algorithm , Kruskal Algorithm
Some problems are such that a greedy solution will actually be optimal, and sometimes they're engineered that way. A fun example is that many countries' coin values are such that a greedy approach to returning change (i.e. always returning the largest-possible coin until you're done) works.
http://en.wikipedia.org/wiki/Greedy_algorithm