tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
16
Task/Permutation-test/Ada/permutation-test-2.ada
Normal file
16
Task/Permutation-test/Ada/permutation-test-2.ada
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
generic
|
||||
Subset_Size, More_Elements: Positive;
|
||||
package Iterate_Subsets is
|
||||
|
||||
All_Elements: Positive := Subset_Size + More_Elements;
|
||||
subtype Index is Integer range 1 .. All_Elements;
|
||||
type Subset is array (1..Subset_Size) of Index;
|
||||
|
||||
-- iterate over all subsets of size Subset_Size
|
||||
-- from the set {1, 2, ..., All_Element}
|
||||
|
||||
function First return Subset;
|
||||
procedure Next(S: in out Subset);
|
||||
function Last(S: Subset) return Boolean;
|
||||
|
||||
end Iterate_Subsets;
|
||||
Loading…
Add table
Add a link
Reference in a new issue