in Combinatory recategorized by
128 views
1 vote
1 vote

The number of possible subsequences in a string of length n are:

  1. $n^{2}$
  2. $2^{n}$ 
  3. n!
  4. n(n-1)
in Combinatory recategorized by
128 views

2 Comments

Answer: B

Which is equal to all possible subsets. For every character you have two choice either take or don’t.
0
0

1 Answer

0 votes
0 votes

B. 2^n ...

 

The problem of counting distinct subsequences is easy if all characters of input string are distinct…..

The count is equal to nC0 + nC1 + nC2 + … nCn = 2^n...

by

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
4
rsansiya111 asked in Computer Networks Dec 9, 2021
196 views
rsansiya111 asked in Computer Networks Dec 9, 2021
196 views