#754
Inordine1
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se afișeze valorile memorate în arbore în urma parcurgerii în inordine.
Problema | Inordine1 | Operații I/O |
inordine1.in /inordine1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29020575 | Utilizator | |
Fișier | inordine1.cpp | Dimensiune | 577 B |
Data încărcării | 27 Martie 2021, 21:30 | Scor / rezultat | Eroare de compilare |
inordine1.cpp:10:9: error: field 'st' has incomplete type nod st,dr; ^ inordine1.cpp:10:12: error: field 'dr' has incomplete type nod st,dr; ^ inordine1.cpp: In function 'void creare(nod&)': inordine1.cpp:19:10: error: no match for 'operator=' (operand types are 'nod' and 'int') p=NULL; ^ inordine1.cpp:19:10: note: candidates are: inordine1.cpp:7:8: note: nod& nod::operator=(const nod&) struct nod ^ inordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'const nod&' inordine1.cpp:7:8: note: nod& nod::operator=(nod&&) inordine1.cpp:7:8: note: no known conversion for argument 1 from 'int' to 'nod&&' inordine1.cpp:22:10: error: no match for 'operator=' (operand types are 'nod' and 'nod*') p=new nod; ^ inordine1.cpp:22:10: note: candidates are: inordine1.cpp:7:8: note: nod& nod::operator=(const nod&) struct nod ^ inordine1.cpp:7:8: note: no known conversion for argument 1 from 'nod*' to 'const nod&' inordine1.cpp:7:8: note: nod& nod::operator=(nod&&) inordine1.cpp:7:8: note: no known conversion for argument 1 from 'nod*' to 'nod&&' inordine1.cpp:23:10: error: base operand of '->' has non-pointer type 'nod' p->info=x; ^ inordine1.cpp:24:17: error: base operand of '->' has non-pointer type 'nod' creare(p->st); ^ inordine1.cpp:25:17: error: base operand of '->' has non-pointer type 'nod' creare(p->dr); ^ inordine1.cpp: In function 'void inordine(nod*)': inordine1.cpp:33:21: error: 'struct nod' has no member named 'st' inordine(p->st); ^ inordine1.cpp:35:21: error: 'struct nod' has no member named 'dr' inordine(p->dr); ^ inordine1.cpp: In function 'int main()': inordine1.cpp:43:13: error: invalid initialization of reference of type 'nod&' from expression of type 'nod*' creare(p); ^ inordine1.cpp:14:6: error: in passing argument 1 of 'void creare(nod&)' void creare(nod&p) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Inordine1 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ă.