#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 | #64726871 | Utilizator | |
| Fișier | postordine.cpp | Dimensiune | 736 B |
| Data încărcării | 26 Mai 2026, 11:48 | Scor/rezultat | Eroare de compilare |
postordine.cpp: In function ‘void postordine(int)’: postordine.cpp:17:23: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 17 | postordine(arb[nod].st); | ^ postordine.cpp:18:23: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 18 | postordine(arb[nod].dr); | ^ postordine.cpp:19:20: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 19 | fout << arb[nod].val << " "; | ^ postordine.cpp: In function ‘int main()’: postordine.cpp:28:19: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 28 | fin >> arb[i].val >> arb[i].st >> arb[i].dr; | ^ postordine.cpp:28:33: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 28 | fin >> arb[i].val >> arb[i].st >> arb[i].dr; | ^ postordine.cpp:28:46: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 28 | fin >> arb[i].val >> arb[i].st >> arb[i].dr; | ^ postordine.cpp:29:16: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 29 | if (arb[i].st != 0) tata[arb[i].st] = i; | ^ postordine.cpp:29:37: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 29 | if (arb[i].st != 0) tata[arb[i].st] = i; | ^ postordine.cpp:30:16: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 30 | if (arb[i].dr != 0) tata[arb[i].dr] = i; | ^ postordine.cpp:30:37: error: no match for ‘operator[]’ (operand types are ‘Nod’ and ‘int’) 30 | if (arb[i].dr != 0) tata[arb[i].dr] = i; | ^ postordine.cpp:34:16: error: invalid types ‘int[int]’ for array subscript 34 | while (tata[radacina] != 0) | ^ postordine.cpp:36:24: error: invalid types ‘int[int]’ for array subscript 36 | radacina = tata[radacina]; | ^
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ă.