#3010
bst
Un arbore binar de căutare (BST – Binary Search Tree) este un arbore binar cu proprietatea că valoarea memorată într-un nod este mai mare decât valoarea memorată în orice nod din subarborele său stâng și este mai mică sau egală decât valoarea memorată în orice nod din subarborele său drept. Dându-se un șir de n
numere naturale, să se ordoneze crescător utilizând un BST.
Folclorul informatic
Problema | bst | Operații I/O |
bst.in /bst.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50414228 | Utilizator | |
Fișier | bst.cpp | Dimensiune | 1.88 KB |
Data încărcării | 08 Aprilie 2024, 19:26 | Scor / rezultat | Eroare de compilare |
bst.cpp:58:2: error: stray '#' in program }#include <iostream> ^ bst.cpp:58:3: error: 'include' does not name a type }#include <iostream> ^ bst.cpp:62:5: error: redefinition of 'int n' int n; ^ bst.cpp:5:5: error: 'int n' previously declared here int n; ^ bst.cpp:63:13: error: redefinition of 'std::ifstream fin' ifstream fin("bst.in"); ^ bst.cpp:6:10: error: 'std::ifstream fin' previously declared here ifstream fin("bst.in"); ^ bst.cpp:64:14: error: redefinition of 'std::ofstream fout' ofstream fout("bst.out"); ^ bst.cpp:7:10: error: 'std::ofstream fout' previously declared here ofstream fout("bst.out"); ^ bst.cpp:66:8: error: redefinition of 'struct Nod' struct Nod { ^ bst.cpp:9:8: error: previous definition of 'struct Nod' struct Nod { ^ bst.cpp: In function 'void Inserare(Nod*&, int)': bst.cpp:71:6: error: redefinition of 'void Inserare(Nod*&, int)' void Inserare(Nod*& rad, int x) { ^ bst.cpp:14:6: error: 'void Inserare(Nod*&, int)' previously defined here void Inserare(Nod*& rad, int x) { ^ bst.cpp: In function 'void Creare(Nod*&)': bst.cpp:89:6: error: redefinition of 'void Creare(Nod*&)' void Creare(Nod*& rad) ^ bst.cpp:32:6: error: 'void Creare(Nod*&)' previously defined here void Creare(Nod*& rad) ^ bst.cpp: In function 'void Afisare(Nod*)': bst.cpp:100:6: error: redefinition of 'void Afisare(Nod*)' void Afisare(Nod* rad) { ^ bst.cpp:43:6: error: 'void Afisare(Nod*)' previously defined here void Afisare(Nod* rad) { ^ bst.cpp: In function 'int main()': bst.cpp:109:5: error: redefinition of 'int main()' int main() ^ bst.cpp:52:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema bst 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ă.