if someone could explain this code for me, and make an easier code to understand , i tried to sort this but no results, this one is complicated for a beginner and doesn't complete the job, i need subsequences of a string sorted like this : we give "abc", we get this :
- a
- ab
- ac
- abc
- b
- bc
- c
the code i found in a website
**buildSubsequences("abc");
public static List<String> buildSubsequences(String s) {
List<String> result = new ArrayList<String>() ;
char[] strSplit = s.toCharArray();
for (int m = 1 ; m != 1<<strSplit.length ; m++) {
for (int i = 0 ; i != strSplit.length ; i++) {
if ((m & (1<<i)) != 0) {
result.add(String.valueOf(strSplit[i]));
System.out.print(strSp开发者_运维技巧lit[i]);
}
}
System.out.print("\n");
}
return null;
}**
精彩评论