#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 | #54081206 | Utilizator | |
Fișier | preordine.cpp | Dimensiune | 860 B |
Data încărcării | 19 Noiembrie 2024, 12:37 | Scor / rezultat | Eroare de compilare |
preordine.cpp:8:13: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ preordine.cpp:8:21: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ preordine.cpp:8:29: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ preordine.cpp: In function 'void citire()': preordine.cpp:14:16: error: 'info' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ preordine.cpp:14:27: error: 'st' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ preordine.cpp:14:36: error: 'dr' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ preordine.cpp: In function 'int radacina()': preordine.cpp:19:11: error: 'NN' was not declared in this scope int v[NN]; ^ preordine.cpp:21:9: error: 'v' was not declared in this scope v[i] = 0; ^ preordine.cpp:24:12: error: 'st' was not declared in this scope if(st[i] != 0) ^ preordine.cpp:25:13: error: 'v' was not declared in this scope v[st[i]] = 1; ^ preordine.cpp:26:12: error: 'dr' was not declared in this scope if(dr[i] != 0) ^ preordine.cpp:27:13: error: 'v' was not declared in this scope v[dr[i]] = 1; ^ preordine.cpp:30:12: error: 'v' was not declared in this scope if(v[i] == 0) ^ preordine.cpp: In function 'void preordine(int)': preordine.cpp:39:17: error: 'info' was not declared in this scope fout << info[x] << " "; ^ preordine.cpp:40:19: error: 'st' was not declared in this scope preordine(st[x]); ^ preordine.cpp:41:19: error: 'dr' was not declared in this scope preordine(dr[x]); ^
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ă.