#4860
Se consideră un arbore binar cu n noduri numeroate de 1 la n pentru care se cunosc parcurgerile în preordine și inordine. Să se afișeze nodurile din arbore în urma parcurgerii în postordine.
| Problema | Construct_Arbore | Operații I/O |
construct_arbore.in/construct_arbore.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #60212284 | Utilizator | |
| Fișier | construct_arbore.c | Dimensiune | 964 B |
| Data încărcării | 21 Octombrie 2025, 17:25 | Scor/rezultat | 0 puncte |
construct_arbore.c: In function 'printPostOrder': construct_arbore.c:19:5: warning: passing argument 1 of 'fprintf' from incompatible pointer type [enabled by default] fprintf(fnane,"%c ", root); ^ In file included from /usr/include/stdio.h:937:0, from construct_arbore.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'struct FILE * restrict' but argument is of type 'const char *' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ construct_arbore.c: In function 'main': construct_arbore.c:30:5: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d",&n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from construct_arbore.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ construct_arbore.c:30:5: warning: passing argument 2 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d",&n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from construct_arbore.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ construct_arbore.c:30:5: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d",&n); ^ construct_arbore.c:32:9: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d",&preorder[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from construct_arbore.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ construct_arbore.c:32:9: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d",&preorder[i]); ^ construct_arbore.c:34:9: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d",&inorder[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from construct_arbore.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ construct_arbore.c:34:9: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d",&inorder[i]); ^ construct_arbore.c:26:11: warning: unused variable 'g' [-Wunused-variable] FILE *g =fopen(fnane, "w"); ^ construct_arbore.c:25:11: warning: unused variable 'f' [-Wunused-variable] FILE *f = fopen(fname, "r"); ^ construct_arbore.c:30:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d",&n); ^ construct_arbore.c:32:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d",&preorder[i]); ^ construct_arbore.c:34:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d",&inorder[i]); ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
| 2 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
| 3 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 4 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 5 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
| 6 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Construct_Arbore face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.