#672
Se dă un arbore binar care conține valori numere naturale. Să se afișeze valorile din arbore în urma parcurgerii în postordine.
Notă: pentru reprezentarea arborelui se recomandă alocarea statică, folosind tablouri.
| Problema | Postordine | Operații I/O |
postordine.in/postordine.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64840768 | Utilizator | |
| Fișier | postordine.cpp | Dimensiune | 628 B |
| Data încărcării | 05 Iunie 2026, 17:13 | Scor/rezultat | 0 puncte |
postordine.cpp: In function ‘int postordine(int)’: postordine.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type] 16 | } | ^ postordine.cpp: In function ‘int main()’: postordine.cpp:19:11: warning: unused variable ‘x’ [-Wunused-variable] 19 | int n,x; | ^ postordine.cpp: In function ‘int postordine(int)’: postordine.cpp:7:5: warning: infinite recursion detected [-Winfinite-recursion] 7 | int postordine(int x) | ^~~~~~~~~~ postordine.cpp:11:19: note: recursive call 11 | postordine(st[x]); | ~~~~~~~~~~^~~~~~~ postordine.cpp: In function ‘int main()’: postordine.cpp:36:15: warning: ‘rad’ may be used uninitialized [-Wmaybe-uninitialized] 36 | postordine(rad); | ~~~~~~~~~~^~~~~ postordine.cpp:28:9: note: ‘rad’ was declared here 28 | int rad; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.009 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
| 2 | 0.009 secunde | Caught fatal signal 11 | 40 | 0 | ||
| 3 | 0.009 secunde | Caught fatal signal 11 | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Postordine 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ă.