Skip to content
Snippets Groups Projects
Commit 70ae27e2 authored by yassin.elhakoun's avatar yassin.elhakoun
Browse files

Update cours_21.md (modif fonction qt_create)

parent e9b95e99
No related branches found
No related tags found
1 merge request!65Update cours_21.md (modif fonction qt_create)
...@@ -197,12 +197,13 @@ arbre creer_arbre(prof) ...@@ -197,12 +197,13 @@ arbre creer_arbre(prof)
```C ```C
node *qt_create(int depth) { node *qt_create(int depth) {
if (depth <= 0) {
return NULL;
}
node *n = calloc(1, sizeof(node)); node *n = calloc(1, sizeof(node));
if (depth > 0) {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
n->child[i] = qt_create(depth-1); n->child[i] = qt_create(depth-1);
} }
}
return n; return n;
} }
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment