#3010
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 | #64081255 | Utilizator | |
| Fișier | bst.cpp | Dimensiune | 844 B |
| Data încărcării | 16 Aprilie 2026, 08:51 | Scor/rezultat | Eroare de compilare |
bst.cpp:3:1: error: ‘stuct’ does not name a type; did you mean ‘struct’? 3 | stuct nod{ | ^~~~~ | struct bst.cpp:7:2: error: ‘r’ does not name a type 7 | }r; | ^ bst.cpp:8:6: error: variable or field ‘initial’ declared void 8 | void initial(nod *&r,x) | ^~~~~~~ bst.cpp:8:14: error: ‘nod’ was not declared in this scope 8 | void initial(nod *&r,x) | ^~~ bst.cpp:8:20: error: ‘r’ was not declared in this scope 8 | void initial(nod *&r,x) | ^ bst.cpp:8:22: error: ‘x’ was not declared in this scope 8 | void initial(nod *&r,x) | ^ bst.cpp:15:6: error: variable or field ‘adauga’ declared void 15 | void adauga(nod *&r,int x) | ^~~~~~ bst.cpp:15:13: error: ‘nod’ was not declared in this scope 15 | void adauga(nod *&r,int x) | ^~~ bst.cpp:15:19: error: ‘r’ was not declared in this scope 15 | void adauga(nod *&r,int x) | ^ bst.cpp:15:21: error: expected primary-expression before ‘int’ 15 | void adauga(nod *&r,int x) | ^~~ bst.cpp: In function ‘int main()’: bst.cpp:43:21: error: ‘r’ was not declared in this scope 43 | initial(r,x); | ^ bst.cpp:43:13: error: ‘initial’ was not declared in this scope 43 | initial(r,x); | ^~~~~~~ bst.cpp:44:16: error: ‘r’ was not declared in this scope 44 | adauga(r,x); | ^ bst.cpp:44:9: error: ‘adauga’ was not declared in this scope 44 | adauga(r,x); | ^~~~~~
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ă.