Skip to content
Snippets Groups Projects
Verified Commit e2face64 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added new struct

parent cee8957d
No related branches found
No related tags found
No related merge requests found
Pipeline #16196 passed
...@@ -432,4 +432,49 @@ struct _node { ...@@ -432,4 +432,49 @@ struct _node {
::: :::
# Une fonctionnalité simple
\footnotesize
## La fonction `est_feuille(noeud)`
* Problème avec cette implémentation?
```pyrhon
bool est_feuille(noeud)
retourne
est_vide(sup_gauche(noeud)) &&
est_vide(sup_droit(noeud)) &&
est_vide(inf_gauche(noeud)) &&
est_vide(inf_droit(noeud))
```
. . .
* Facile d'en oublier un!
* Comment changer la structure pour que ça soit moins terrible?
. . .
```python
struct node
info
node sup_gauche[4]
```
# Une fonctionnalité simple
## En C?
. . .
```C
typedef struct _node {
int info;
struct _node *children;
} node;
typedef node *tree;
```
# Implémentation # Implémentation
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment