derniere maj du td3 de C pour le rendu en zip

This commit is contained in:
2024-10-16 00:20:05 +02:00
parent 3a1e525a4b
commit a65075b162
19 changed files with 0 additions and 23 deletions

View File

@@ -45,7 +45,6 @@ void hanoi(int n) {
int max = n;
int *count = 0;
hanoi_rec(p1, p2, p3, p1, p2, p3, n, max, count);
print_stacks(max, 3, p1, p2, p3);
return;
}
@@ -53,11 +52,9 @@ void hanoi_rec(stack *p1, stack *p2, stack *p3,
stack *q1, stack *q2, stack *q3,
int n, int max, int *count) {
if (n == 0) {
// print_stacks(max, 3, q1, q2, q3);
return;
};
hanoi_rec(p1, p3, p2, q1, q2, q3, n-1, max, count);
print_stacks(max, 3, q1, q2, q3);
push(pop(p1), p3);
hanoi_rec(p2, p1, p3, q1, q2, q3, n-1, max, count);
return;
@@ -70,7 +67,6 @@ void bubble_sort_stack(stack *p) {
for (int j = 0; j < n - 1; j++) {
push(pop(p), p_aux);
}
print_stacks(n - i, 2, p, p_aux);
for (int j = i; j < n - 1; j++) {
int a = pop(p);
int b = pop(p_aux);
@@ -85,7 +81,6 @@ void bubble_sort_stack(stack *p) {
for (int j = 0; j < i; j++) {
push(pop(p_aux), p);
}
printf("\n");
}
delete_stack(p_aux);
return;