Greedy AlgorithmsLast Updated : 26 Sep, 2023ReadDiscussCoursesDSA for BeginnersLearn more about Greedy Algorithms in DSA Self Paced CoursePractice Problems on Greedy AlgorithmsTop Quizzes on Greedy AlgorithmsWhat is Greedy Algorithm?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. So the problems where choosing locally optimal also leads to global solution are the best fit for Greedy.For example consider the Fractional Knapsack Problem. The local optimal strategy is to choose the item that has maximum value vs weight ratio. This strategy also leads to a globally optimal solution because we are allowed to take fractions of an item.Topics:IntroductionStandard Greedy AlgorithmsGreedy Problems on ArrayGreedy Problems on Operating SystemGreedy Problems on GraphApproximate Greedy Algorithms for NP Complete ProblemsGreedy for Special Cases of DPSome Practice problems on GreedyQuick LinksIntroduction:Introduction to Greedy Algorithm – Data Structures and Algorithm TutorialsGreedy Algorithms (General Structure and Applications)Difference between Greedy Algorithm and Divide and Conquer AlgorithmGreedy approach vs Dynamic programmingComparison among Greedy, Divide and Conquer and Dynamic Programming algorithmStandard Greedy Algorithms:Activity Selection ProblemJob Sequencing ProblemHuffman CodingHuffman DecodingWater Connection ProblemMinimum Swaps for Bracket BalancingEgyptian FractionPolicemen catch thievesFitting Shelves ProblemAssign Mice to HolesGreedy Problems on Array:Minimum product subset of an arrayMaximize array sum after K negations using SortingMinimum sum of product of two arraysMinimum sum of absolute difference of pairs of two arraysMinimum increment/decrement to make array non-IncreasingSorting array with reverse around middleSum of Areas of Rectangles possible for an arrayLargest lexicographic array with at-most K consecutive swapsPartition into two subarrays of lengths k and (N – k) such that the difference of sums is maximumGreedy Problems on Operating System:First Fit algorithm in Memory ManagementBest Fit algorithm in Memory ManagementWorst Fit algorithm in Memory ManagementShortest Job First SchedulingJob Scheduling with two jobs allowed at a timeProgram for Optimal Page Replacement AlgorithmGreedy Problems on Graph:Kruskal’s Minimum Spanning TreePrim’s Minimum Spanning TreeBoruvka’s Minimum Spanning TreeDijkastra’s Shortest Path AlgorithmDial’s AlgorithmMinimum cost to connect all citiesMax Flow Problem IntroductionNumber of single cycle components in an undirected graphApproximate Greedy Algorithm for NP Complete:Set cover problemBin Packing ProblemGraph ColoringK-centers problemShortest superstring problemApproximate solution for Travelling Salesman Problem using MSTGreedy for Special cases of DP:Fractional Knapsack ProblemMinimum number of coins requiredSome practice problems on Greedy:Easy:Split n into maximum composite numbersBuy Maximum Stocks if i stocks can be bought on i-th dayFind the minimum and maximum amount to buy all N candiesMaximum sum possible equal to sum of three stacksDivide cuboid into cubes such that sum of volumes is maximumMaximum number of customers that can be satisfied with given quantityMinimum rotations to unlock a circular lockMinimum rooms for m events of n batches with given scheduleMinimum cost to make array size 1 by removing larger of pairsMinimum cost for acquiring all coins with k extra coins allowed with every coinMinimum increment by k operations to make all elements equalFind minimum number of currency notes and values that sum to given amountSmallest subset with sum greater than all other elementsMedium:Maximum trains for which stoppage can be providedMinimum Fibonacci terms with sum equal to KDivide 1 to n into two groups with minimum sum differencePaper cut into minimum number of squaresMinimum difference between groups of size twoConnect n ropes with minimum costMinimum number of Platforms required for a railway/bus stationMinimum initial vertices to traverse whole matrix with given conditionsLargest palindromic number by permuting digitsFind Smallest number with given number of digits and digits sumLexicographically largest subsequence such that every character occurs at least k timesHard:Maximum elements that can be made equal with k updatesMinimize cash flow among friendsMinimum Cost to cut a board into squaresMinimum cost to process m tasks where switching costsMinimum time to finish all jobs with given constraintsMinimize the maximum difference between the heights of towersMinimum edges to reverse to make path from a source to a destinationFind the Largest Cube formed by Deleting minimum Digits from a numberRearrange characters in a string such that no two adjacent are sameRearrange a string so that all same characters become d distance awayQuick Links :Learn Data Structure and Algorithms | DSA TutorialTop 20 Greedy Algorithms Interview Questions‘Practice Problems’ on Greedy Algorithms‘Quiz’ on Greedy AlgorithmsIf you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.