Skip to content
Snippets Groups Projects
Commit 0fb5dd91 authored by andreia.oliveira's avatar andreia.oliveira
Browse files

0

parent c9cb466d
No related branches found
No related tags found
No related merge requests found
......@@ -42,10 +42,21 @@ void permu_alea(int *tab, int size){
print_tab(tab, size);
}
void permu_cyclique(int *tab, int size, int deca){
for(int i = 0; i < size; i++){
tab[i] = (tab[i]+deca)%size;
for(int i = 0; i < deca; i++){
int tmp = tab[size-1];
for(int j = size-1; j != 0; j++){
tab[j] = tab[j-1];
}
tab[0] = tmp;
}
print_tab(tab, size);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment