1

Is it possible to use dynamic programming in the calculation of power set of a string (ie, all possible subsequences of that string) to reduce the number of computations significantly?

Hooked
  • 84,485
  • 43
  • 192
  • 261

2 Answers2

2

No. If you are calculating a powerset, you are calculating a powerset, which always has the same number of elements.

Marcin
  • 48,559
  • 18
  • 128
  • 201
2

You can never reduce complexity below linear with the size of the output, because you need go through each of the output bits some way or another. This is true for all problems, regardless of algorithm used. So 2^n is the lower bound for computation of the power set, because you need to output 2^n strings (and every string is multiple characters, which depends on n on average, so even higher).

svinja
  • 5,495
  • 5
  • 25
  • 43