Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Use Javautillinkedlist Print Subsets Giving String Using Cstatejava Given String Abcdef Li Q35622762

Use java.util.LinkedList toprint out all subsets for a giving string. Using CState.java : Fora given string “abcdef”, list out all possible nonempty subsetstring of

“abcdef” using Queue data structure.  

For example: a,ab,b,abc,ac,bc, etc.

CState.java:

public class CState {

private String Prefix = new String();
private String Suffix = new String();
public CState (String Pre, String Suff)
{
Prefix = Pre;
Suffix = Suff;
}
public String pre()
{
return Prefix;
}
public String suff()
{
return Suffix;
}

public String toString() {
       return Prefix + Suffix;
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *