diff --git a/slides/cours_10.md b/slides/cours_10.md index 6d340218ea3aa59b6664fd4307905972e3e8e16b..5237e47b9b91e7f9352913558b05ece9e077bc8b 100644 --- a/slides/cours_10.md +++ b/slides/cours_10.md @@ -171,6 +171,8 @@ Infixe Postfixe Pile Priorité . . . +* Une sorte de corrigé: + ```C char *infix_to_postfix(char* infix) { // init and alloc stack and postfix for (size_t i = 0; i < strlen(infix); ++i) { @@ -178,7 +180,6 @@ char *infix_to_postfix(char* infix) { // init and alloc stack and postfix // we just add operands in the new postfix string } else if (infix[i] == '(') { // we push opening parenthesis into the stack - stack_push(&s, infix[i]); } else if (infix[i] == ')') { // we pop everything into the postfix } else if (is_operator(infix[i])) { @@ -426,7 +427,7 @@ void stack_destroy(stack *s) { ## Implémentation possible -* La structure file, contient un pointeur vers la tête et un vers la queue. +* La structure file, contient un pointeur vers la tête et un vers le début de la file. * Entre les deux, les éléments sont stockés dans une liste chaînée (comme une pile). @@ -547,7 +548,4 @@ int queue_dequeue(queue *fa) { } ``` -. . . - -## Problème avec cette implémentation?