Won’t we be making complexity as 2^n by using recursion?
we are calling function twice for each index function call. That’s very high complexity I guess. cant we reduce it?
Subset Problem Hint
If you don’t memoize, definitely you will end up with an exponentail complexity. But rarely in practice do we leave it as such. We should memoize i.e. use the concept of dynamic programming. That greatly reduces the complexity.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.