cosmos icon indicating copy to clipboard operation
cosmos copied to clipboard

recursion subsequences

Open Madhupatel08 opened this issue 6 years ago • 3 comments

This is a(n):

  • [ ] New algorithm
  • [ ] Update to an existing algorithm
  • [ ] Error
  • [ ] Proposal to the Repository

Details:

Take as input str, a string. We are concerned with all the possible subsequences of str. E.g. “abcd” has following subsequences “”, “d”, “c”, “cd”, “b”, “bd”, “bc”, “bcd”, “a”, “ad”, “ac”, “acd”, “ab”, “abd”, “abc”, “abcd”.

a. Write a recursive function which returns the count of subsequences for a given string. Print the value returned.

b. Write a recursive function which returns an ArrayList of subsequences for a given string. Print the value returned.

c. Write a recursive function which prints all possible subsequences for a given string (void is the return type for function).

Example(To be used only for expected output): Input: abc output 8 [, a, b, ab, c, ac, bc, abc]

c b bc a ac ab abc

Madhupatel08 avatar Apr 12 '20 13:04 Madhupatel08

Please assign me this issue . I want to implement it in C++ and Java

shivanidalmia1203 avatar Apr 29 '20 08:04 shivanidalmia1203

Please assign me this issue . I can implement it in Java

anahita-singla avatar May 05 '20 23:05 anahita-singla

please assign this issue to me I can do it in java.

shubha028 avatar May 08 '20 15:05 shubha028