#670
Preordine
Se dă un arbore binar care conține valori numere naturale. Să se afișeze valorile din arbore în urma parcurgerii în preordine.
Problema | Preordine | Operații I/O |
preordine.in /preordine.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #28955652 | Utilizator | |
Fișier | preordine.cpp | Dimensiune | 677 B |
Data încărcării | 24 Martie 2021, 21:11 | Scor / rezultat | Eroare de compilare |
preordine.cpp:9:1: error: 'f' does not name a type f>>n; ^ preordine.cpp:10:8: error: array bound is not an integer constant before ']' token s a[n+1]; ^ preordine.cpp:11:10: error: array bound is not an integer constant before ']' token int v[n+1]; ^ preordine.cpp: In function 'void sub(int)': preordine.cpp:15:8: error: 'a' was not declared in this scope if(a[rad].st!=0) ^ preordine.cpp:17:8: error: 'a' was not declared in this scope if(a[rad].dr!=0) ^ preordine.cpp: In function 'int main()': preordine.cpp:24:12: error: 'a' was not declared in this scope f>>a[i].x>>a[i].st>>a[i].dr; ^ preordine.cpp:25:12: error: 'st' was not declared in this scope if(st!=0) ^ preordine.cpp:26:13: error: 'v' was not declared in this scope v[st]++; ^ preordine.cpp:27:12: error: 'dr' was not declared in this scope if(dr!=0) ^ preordine.cpp:28:13: error: 'v' was not declared in this scope v[dr]++; ^ preordine.cpp:32:12: error: 'v' was not declared in this scope if(v[i]==0) ^ preordine.cpp:34:13: error: 'r' was not declared in this scope r=i; ^ preordine.cpp:38:9: error: 'r' was not declared in this scope sub(r); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Preordine 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ă.