You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sanjarcode
changed the title
Dividing problem into how many sections for DnC minimum problem size > 2
Dividing problem into halves for DnC doesn't always work
Jul 7, 2022
sanjarcode
changed the title
Dividing problem into halves for DnC doesn't always work
Dividing problem into halves for DnC may not always work
Jul 7, 2022
Also, it's important to solve non-classic problems that use DnC (e.g. just knowing merge sort as a way to do DnC is not good enough). My way is this - write two functions - helper and combine. combine does solution re-combination (the second half of DnC). The helper does just one thing - it solves partitions of the problem, and combines the solutions using combine.
sanjarcode
changed the title
Dividing problem into halves for DnC may not always work
Dividing problem into "very small halves" for DnC may not always work
Jul 7, 2022
I first encountered the problem here. Dividing into halves doesn't work here because the minimum problem size is > 2 (4 in this case).
Questions:
https://leetcode.com/submissions/detail/740514206/
The text was updated successfully, but these errors were encountered: