Java Program to find all subsets of a string
In this program, all the subsets of the string need to be printed. The subset of a string is the character or the group of characters that are present inside the string.
All the possible subsets for a string will be n(n+1)/2.
For example, all possible subsets of a string "FUN" will be F, U, N, FU, UN, FUN.
To complete this program, we need to run two for loops. The outer loop is used to maintain the relative position of the first character and the second loop is used to create all possible subsets and prints them one by one.
The algorithm of the program is given below.
All subsets for given string are: F FU FUN U UN N