I have a million integers in sorted order and I would like to find the longest subsequence where the difference between consecutive pairs is equal. For example
Greedy method
1 .Only one sequence of decision is generated.
2. Many number of decisions are generated.
Dynamic programming
1. It does not guarantee to give an optimal solution always.
2. It definitely gives an optimal solution.