- 双指针选择
- 组合问题
- 区间问题(活动安排)
- 0-1背包问题
- Standard Greedy Algorithms">Standard Greedy Algorithms
- Greedy Algorithms in Graphs">Greedy Algorithms in Graphs
- Greedy Algorithms in Operating Systems">Greedy Algorithms in Operating Systems
- Greedy Algorithms in Arrays">Greedy Algorithms in Arrays
- Approximate Greedy Algorithms for NP Complete Problems">Approximate Greedy Algorithms for NP Complete Problems
- Misc">Misc
- Quick Links">Quick Links
双指针选择
45. 跳跃游戏 II
55. 跳跃游戏
122. 买卖股票的最佳时机 II
134. 加油站
135. 分发糖果
179. 最大数
253. 会议室 II
316. 去除重复字母
334. 递增的三元子序列
376. 摆动序列
402. 移掉 K 位数字
406. 根据身高重建队列
409. 最长回文串
410. 分割数组的最大值
435. 无重叠区间
452. 用最少数量的箭引爆气球
455. 分发饼干
502. IPO
561. 数组拆分 I
581. 最短无序连续子数组
611. 有效三角形的个数
621. 任务调度器
========================
624. 数组列表中的最大距离
670. 最大交换
678. 有效的括号字符串
680. 验证回文字符串 Ⅱ
714. 买卖股票的最佳时机含手续费
738. 单调递增的数字
763. 划分字母区间
========================
765. 情侣牵手
767. 重构字符串
781. 森林中的兔子
826. 安排工作以达到最大收益
860. 柠檬水找零
861. 翻转矩阵后的得分
881. 救生艇
921. 使括号有效的最少添加
945. 使数组唯一的最小增量
954. 二倍数对数组
991. 坏了的计算器
1005. K 次取反后最大化的数组和
1011. 在 D 天内送达包裹的能力
1024. 视频拼接
1029. 两地调度
1053. 交换一次的先前排列
1081. 不同字符的最小子序列
1382. 将二叉搜索树变平衡
1217. 玩筹码
1221. 分割平衡字符串
1247. 交换字符使得字符串相同
1262. 可被三整除的最大和
1353. 最多可以参加的会议数目
1386. 安排电影院座位
1400. 构造 K 个回文字符串
1488. 避免洪水泛滥
1605. 给定行和列的和求可行矩阵
1647. 字符频次唯一的最小删除次数
1663. 具有给定数值的最小字符串
1689. 十-二进制数的最少数目
1710. 卡车上的最大单元数
1713. 得到子序列的最少操作次数
1792. 最大平均通过率
1846. 减小和重新排列数组后的最大元素
1833. 雪糕的最大数量
1877. 数组中最大数对和的最小值
1996. 游戏中弱角色的数量
剑指 Offer 45. 把数组排成最小的数
面试题 10.11. 峰与谷
组合问题
https://blog.csdn.net/effective_coder/article/details/8736718
删除
拼接
修改
区间问题(活动安排)
0-1背包问题
Standard Greedy Algorithms
- Activity Selection Problem
- Egyptian Fraction
- Job Sequencing Problem
- Job Sequencing Problem (Using Disjoint Set)
- Job Sequencing Problem – Loss Minimization
- Job Selection Problem – Loss Minimization Strategy | Set 2
- Huffman Coding
- Efficient Huffman Coding for sorted input
- Huffman Decoding
- Water Connection Problem
- Policemen catch thieves
- Minimum Swaps for Bracket Balancing
- Fitting Shelves Problem
-
Greedy Algorithms in Graphs
- Prim’s Minimum Spanning Tree
- Boruvka’s Minimum Spanning Tree
- Reverse delete algorithm for MST
- Problem Solving for Minimum Spanning Trees (Kruskal’s and Prim’s)
- Dijkastra’s Shortest Path Algorithm
- Dial’s Algorithm
- Dijkstra’s Algorithm for Adjacency List Representation
- Prim’s MST for adjacency list representation
- Correctness of Greedy Algorithms
- Minimum cost to connect all cities
- Max Flow Problem Introduction
Number of single cycle components in an undirected graph
Greedy Algorithms in Operating Systems
- Best Fit algorithm in Memory Management
- Worst Fit algorithm in Memory Management
- Operating System | Program for Next Fit algorithm in Memory Management
- Shortest Job First Scheduling
- Program for Shortest Job First (SJF) scheduling | Set 2 (Preemptive)
- Schedule jobs so that each server gets equal load
- Job Scheduling with two jobs allowed at a time
- Scheduling priority tasks in limited time and minimizing loss
- Program for Optimal Page Replacement Algorithm
- Program for Page Replacement Algorithms | Set 1 ( LRU)
Program for Page Replacement Algorithms | Set 2 (FIFO)
Greedy Algorithms in Arrays
- Maximum product subset of an array
- Maximize array sum after k-negations | Set 1
- Maximize array sum after k-negations | Set 2
- Maximize the sum of arr[i]*i
- Maximum sum of increasing order elements from n arrays
- Maximum sum of absolute difference of an array
- Maximize sum of consecutive differences in a circular array
- Maximum height pyramid from the given array of objects
- Partition into two subarrays of lengths k and (N – k) such that the difference of sums is maximum
- Minimum sum of product of two arrays
- Minimum sum by choosing minimum of pairs from array
- Minimum sum of absolute difference of pairs of two arrays
- Minimum operations to make GCD of array a multiple of k
- Minimum sum of absolute difference of pairs of two arrays
- Minimum sum of two numbers formed from digits of an array
- Minimum increment/decrement to make array non-Increasing
- Making elements of two arrays same with minimum increment/decrement
- Minimize sum of product of two arrays with permutation allowed
- Sorting array with reverse around middle
- Sum of Areas of Rectangles possible for an array
- Array element moved by k using single moves
- Find if k bookings possible with given arrival and departure times
- Lexicographically smallest array after at-most K consecutive swaps
Largest lexicographic array with at-most K consecutive swaps
Approximate Greedy Algorithms for NP Complete Problems
- Bin Packing Problem
- Graph Coloring
- K-centers problem
- Shortest superstring problem
- Travelling Salesman Problem | Set 1 (Naive and Dynamic Programming)
- Traveling Salesman Problem | Set 2 (Approximate using MST)
- Fractional Knapsack Problem
Minimum number of coins required
Misc
- Maximum trains for which stoppage can be provided
- Buy Maximum Stocks if i stocks can be bought on i-th day
- Find the minimum and maximum amount to buy all N candies
- Maximum sum possible equal to sum of three stacks
- Maximum elements that can be made equal with k updates
- Divide cuboid into cubes such that sum of volumes is maximum
- Maximum number of customers that can be satisfied with given quantity
- Minimum Fibonacci terms with sum equal to K
- Divide 1 to n into two groups with minimum sum difference
- Minimize cash flow among friends
- Minimum rotations to unlock a circular lock
- Paper cut into minimum number of squares
- Minimum difference between groups of size two
- Minimum rooms for m events of n batches with given schedule
- Connect n ropes with minimum cost
- Minimum Cost to cut a board into squares
- Minimum cost to process m tasks where switching costs
- Minimum cost to make array size 1 by removing larger of pairs
- Minimum cost for acquiring all coins with k extra coins allowed with every coin
- Minimum time to finish all jobs with given constraints
- Minimum number of Platforms required for a railway/bus station
- Minimize the maximum difference between the heights of towers
- Minimum increment by k operations to make all elements equal
- Minimum edges to reverse to make path from a source to a destination
- Find minimum number of currency notes and values that sum to given amount
- Minimum initial vertices to traverse whole matrix with given conditions
- Find the Largest Cube formed by Deleting minimum Digits from a number
- Check if it is possible to survive on Island
- Largest palindromic number by permuting digits
- Smallest number with sum of digits as N and divisible by 10^N
- Find Smallest number with given number of digits and digits sum
- Rearrange characters in a string such that no two adjacent are same
- Rearrange a string so that all same characters become d distance away
- Print a closest string that does not contain adjacent duplicates
- Smallest subset with sum greater than all other elements
Lexicographically largest subsequence such that every character occurs at least k times
Quick Links
- ‘Practice Problems’ on Greedy Algorithms
- Practice Questions on Huffman Encoding
- ‘Quiz’ on Greedy Algorithms