Longest consecutive subsequence ---IN Brute force how it takes 2^n time complexity ...please explain briefly as ap

longest consecutive subsequence —IN Brute force how it takes 2^n time complexity …please explain briefly as ap…

Hi,

there are 2^n subsequences possible of the array of size n. So To generate all subsequences we need time of 2^n. After that we can check whether each subsequence contains consecutive elements and calculate the longest one.

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.