#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 | #64142035 | Utilizator | |
| Fișier | construct_arbore.cpp | Dimensiune | 558 B |
| Data încărcării | 20 Aprilie 2026, 10:39 | Scor/rezultat | 100 puncte |
construct_arbore.cpp: In function ‘void postord(int, int, int&)’: construct_arbore.cpp:13:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 13 | for(k=st;k<=dr;k++) | ^~~ construct_arbore.cpp:16:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 16 | postord(st,k-1,poz); | ^~~~~~~ construct_arbore.cpp: In function ‘int main()’: construct_arbore.cpp:25:6: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 25 | for(int i=1;i<=n;i++) | ^~~ construct_arbore.cpp:27:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 27 | int poz=1; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| 6 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
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ă.