Algorithms and Data Structures · Junior · Question 71 of 75

What is a greedy algorithm?

Explanation

Greedy algorithms are simple and fast, but they only give the optimal answer for some problems, such as making change with standard coins or picking non-overlapping intervals by earliest end. Trying every combination is brute force.

Further reading

Problem with a question

Algorithms and Data Structures · Junior · question 71

Test yourself

Take the Algorithms and Data Structures · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz