Automate A Pile Exercices Corriges
Si $Y = \epsilon$, on dépile $X$. Si $Y$ est une chaîne de symboles, on empile ces symboles.
$\delta(q_1, \epsilon, Z_0) = (q_f, Z_0)$ (Si on ne lit plus rien et qu'on voit le fond de pile, on va à l'état final). automate a pile exercices corriges
$\delta(q_0, b, A) = (q_1, \epsilon)$ (On lit 'b', on voit 'A' au sommet, on dépile et on passe à l'état $q_1$). Si $Y = \epsilon$, on dépile $X$
Write a program that automatically evaluates a postfix expression (e.g., 5 3 4 + * ) using a stack. The program must reject invalid expressions. $\delta(q_0, b, A) = (q_1, \epsilon)$ (On lit
\endenumerate
You are a teacher. 50 students submit a function reverse_stack(original_stack) that should reverse a stack without using another data structure (only recursion or additional stack). Write an automation script that tests each submission and returns a grade.