The Wayback Machine - https://web.archive.org/web/20250304083940/https://www.geeksforgeeks.org/greedy-algorithms/
Open In App

Greedy Algorithms

Last Updated : 17 Dec, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Greedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. Examples of popular Greedy Algorithms are Fractional Knapsack, Dijkstra's algorithm, Kruskal's algorithm, Huffman coding and Prim's Algorithm

Basics of Greedy Algorithm

Easy Problems on Greedy Algorithm

Medium Problems on Greedy Algorithm

Hard Problems on Greedy Algorithm

Standard Greedy Algorithms

Greedy Problems on Array

Greedy Problems in Operating System

Greedy Problems on Graph

Approximate Greedy Algorithm for NP Complete

Greedy for Special cases of DP

Quick Links

Master Data Structures and Algorithms at your own pace with our DSA Self-Paced course. In just 90 days, you’ll cover core concepts, solve real-world problems, and sharpen your problem-solving skills. Take the Three 90 Challenge: complete 90% of the course in 90 days and get a 90% refund. Stay motivated, track progress, and achieve DSA mastery. Start today!


Next Article
Practice Tags :

Similar Reads

Top 20 Greedy Algorithms Interview Questions
Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. Easy ProblemsActivity Selection Problem Greedy Algorithm to find Minimum number of Coins Job Sequencing Problem Graph coloring Fractional
1 min read
Correctness of Greedy Algorithms
A greedy algorithm selects a candidate greedily (local optimum) and adds it to the current solution provided that it doesn't corrupt the feasibility. If the solution obtained by above step is not final, repeat till global optimum or the final solution is obtained. Although there are several mathematical strategies available to proof the correctness
2 min read
Scheduling in Greedy Algorithms
In this article, we will discuss various scheduling algorithms for Greedy Algorithms. Many scheduling problems can be solved using greedy algorithms. Problem statement: Given N events with their starting and ending times, find a schedule that includes as many events as possible. It is not possible to select an event partially. Consider the below ev
2 min read
Difference Between Greedy Knapsack and 0/1 Knapsack Algorithms
The 0/1 Knapsack algorithm is a dynamic programming approach where items are either completely included or not at all. It considers all combinations to find the maximum total value. On the other hand, the Greedy Knapsack algorithm, also known as the Fractional Knapsack, allows for items to be broken into fractions, selecting items with the highest
9 min read
Greedy Algorithms General Structure
A greedy algorithm solves problems by making the best choice at each step. Instead of looking at all possible solutions, it focuses on the option that seems best right now.Example of Greedy Algorithm - Fractional KnapsackProblem structure:Most of the problems where greedy algorithms work follow these two properties:1). Greedy Choice Property:- This
5 min read
Applications, Advantages and Disadvantages of Greedy Algorithms
Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. Table of ContentApplications of Greedy Algorithms Advantages of Greedy Algorithms Disadvantages of the Greedy ApproachApplications of Gre
3 min read
Comparison among Greedy, Divide and Conquer and Dynamic Programming algorithm
Greedy algorithm, divide and conquer algorithm, and dynamic programming algorithm are three common algorithmic paradigms used to solve problems. Here's a comparison among these algorithms:Approach:Greedy algorithm: Makes locally optimal choices at each step with the hope of finding a global optimum.Divide and conquer algorithm: Breaks down a proble
4 min read
Greedy Best first search algorithm
What is the Greedy-Best-first search algorithm?Greedy Best-First Search is an AI search algorithm that attempts to find the most promising path from a given starting point to a goal. It prioritizes paths that appear to be the most promising, regardless of whether or not they are actually the shortest path. The algorithm works by evaluating the cost
5 min read
What is Greedy Algorithm in DSA?
A Greedy Algorithm is defined as a problem-solving strategy that makes the locally optimal choice at each step of the algorithm, with the hope that this will lead to a globally optimal solution. In other words, a greedy algorithm always chooses the option that seems the best at the moment, without considering the future consequences or possibiliti
4 min read
Activity Selection Problem | Greedy Algo-1
You are given n activities with their start and finish times. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time. Note: Duration of the activity includes both starting and ending day.Examples: Input: start[] = [10, 12, 20], finish[] = [20, 25, 30]
13 min read