recursion instead multi-loops
i wish slight work any given array arguments, i formula generation(with lot dizzy code), finished recursion? how? i know recursion, nonetheless i dont know this.
private stationary vacant allcombinations(list<string>... lists) {
(lists.length == 3) {
(string s3 : lists[0]) {
(string s1 : lists[1]) {
(string s2 : lists[2]) {
system.out.println(s1 + "-" + s2 + "-" + s3);
}
}
}
}
(lists.length == 2) {
(string s3 : lists[0]) {
(string s1 : lists[1]) {
system.out.println(s1 + "-" + s3);
}
}
}
}
Comments
Post a Comment