Subsequences time compleity issue

what is the time complexity of finding subsequences of a string iteratively and recursively

Hi @Rj.25,
The time complexity of finding subsequences is 2^n in both cases.
In iterative method, u need to iterate from 0 to (2^n)-1.(n is the length of string)
In recursive method, u have to make a choice whether to include a particular element or not. So each element has 2 choices, hence 2^n ways for n elements.
Hope dis clear ur doubt.:smile:

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.