What is the primary use of dynamic programming in algorithm design?
-
To solve problems with overlapping subproblems and optimal substructure
-
To sort large datasets efficiently
-
To traverse trees and graphs
-
To implement data structures like stacks and queues