#753
Preordine1
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se afișeze valorile memorate în subarborele stâng al rădăcinii în urma parcurgerii în preordine.
Problema | Preordine1 | Operații I/O |
preordine1.in /preordine1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50476848 | Utilizator | |
Fișier | preordine1.cpp | Dimensiune | 555 B |
Data încărcării | 10 Aprilie 2024, 22:12 | Scor / rezultat | Eroare de compilare |
preordine1.cpp:10:9: error: field 'st' has incomplete type Nod st,dr; ^ preordine1.cpp:10:12: error: field 'dr' has incomplete type Nod st,dr; ^ preordine1.cpp: In function 'void Read(Nod&)': preordine1.cpp:19:11: error: no match for 'operator=' (operand types are 'Nod' and 'int') r = NULL; ^ preordine1.cpp:19:11: note: candidates are: preordine1.cpp:7:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ preordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'const Nod&' preordine1.cpp:7:8: note: Nod& Nod::operator=(Nod&&) preordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'Nod&&' preordine1.cpp:22:7: error: no match for 'operator=' (operand types are 'Nod' and 'Nod*') r = new Nod; ^ preordine1.cpp:22:7: note: candidates are: preordine1.cpp:7:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ preordine1.cpp:7:8: note: no known conversion for argument 1 from 'Nod*' to 'const Nod&' preordine1.cpp:7:8: note: Nod& Nod::operator=(Nod&&) preordine1.cpp:7:8: note: no known conversion for argument 1 from 'Nod*' to 'Nod&&' preordine1.cpp:23:7: error: base operand of '->' has non-pointer type 'Nod' r -> val = x; ^ preordine1.cpp:24:12: error: base operand of '->' has non-pointer type 'Nod' Read(r -> st); ^ preordine1.cpp:25:12: error: base operand of '->' has non-pointer type 'Nod' Read(r -> dr); ^ preordine1.cpp: In function 'void RSD(Nod*)': preordine1.cpp:32:14: error: 'struct Nod' has no member named 'st' RSD(r -> st); ^ preordine1.cpp:33:14: error: 'struct Nod' has no member named 'dr' RSD(r -> dr); ^ preordine1.cpp: In function 'int main()': preordine1.cpp:38:9: error: no match for 'operator=' (operand types are 'Nod' and 'int') rad = NULL; ^ preordine1.cpp:38:9: note: candidates are: preordine1.cpp:7:8: note: Nod& Nod::operator=(const Nod&) struct Nod ^ preordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'const Nod&' preordine1.cpp:7:8: note: Nod& Nod::operator=(Nod&&) preordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'Nod&&' preordine1.cpp:40:13: error: base operand of '->' has non-pointer type 'Nod' RSD(rad -> st); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Preordine1 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ă.