Power set: Difference between revisions

m
Line 3,410:
#<Set: {#<Set: {}>, #<Set: {1}>, #<Set: {2}>, #<Set: {1, 2}>, #<Set: {3}>, #<Set: {1, 3}>, #<Set: {2, 3}>, #<Set: {1, 2, 3}>}>
</pre>
 
 
=={{header|Rust}}==
Line 3,435 ⟶ 3,436:
 
fn main() {
let set = (01..5).collect();
let set = powerset(set);
println!("{:?}", set);
 
let set = ["a", "b", "c", "d"].iter().collect();
let set = powerset(set);
println!("{:?}", set);
Line 3,442 ⟶ 3,447:
 
{{out}}
<pre>
<pre>{{}, {0}, {0, 1}, {0, 1, 2}, {0, 1, 2, 3}, {0, 1, 2, 3, 4}, {0, 1, 2, 4}, {0, 1, 3}, {0, 1, 3, 4}, {0, 1, 4}, {0, 2}, {0, 2, 3}, {0, 2, 3, 4}, {0, 2, 4}, {0, 3}, {0, 3, 4}, {0, 4}, {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 4}, {1, 3}, {1, 3, 4}, {1, 4}, {2}, {2, 3}, {2, 3, 4}, {2, 4}, {3}, {3, 4}, {4}}
{{}, {"a"}, {"a", "b"}, {"a", "b", "c"}, {"a", "b", "c", "d"}, {"a", "b", "d"}, {"a", "c"}, {"a", "c", "d"}, {"a", "d"}, {"b"}, {"b", "c"}, {"b", "c", "d"}, {"b", "d"}, {"c"}, {"c", "d"}, {"d"}}
</pre>
 
 
=={{header|SAS}}==
Anonymous user