Question DSA-DP-0022
EasyWhat does optimal substructure mean?
- A.
The structure of the code is optimal
- B.
The problem has a single solution
- C.
Show answer and explanation
Answer: D
For example, a shortest path is made of shortest sub-paths.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Dynamic Programming question
What does optimal substructure mean?
The structure of the code is optimal
The problem has a single solution
Answer: D
For example, a shortest path is made of shortest sub-paths.
The input is already sorted
An optimal solution can be built from optimal solutions to its subproblems