#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 | #64806238 | Utilizator | |
| Fișier | postordine.cpp | Dimensiune | 511 B |
| Data încărcării | 02 Iunie 2026, 15:46 | Scor/rezultat | 100 puncte |
postordine.cpp: In function ‘void sdr(int)’: postordine.cpp:10:14: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 10 | if(a[rad][3]) sdr(a[rad][3]); | ~~~~~~~~^ postordine.cpp:6:5: note: while referencing ‘a’ 6 | int a[1001][3]; | ^ postordine.cpp: In function ‘int main()’: postordine.cpp:21:13: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 21 | v[a[i][3]]++; | ~~~~~~^ postordine.cpp:6:5: note: while referencing ‘a’ 6 | int a[1001][3]; | ^ postordine.cpp:31:6: warning: ‘k’ may be used uninitialized [-Wmaybe-uninitialized] 31 | sdr(k); | ~~~^~~ postordine.cpp:15:9: note: ‘k’ was declared here 15 | int n,k,v[1001]={0}; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.001 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
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ă.