Quote Originally Posted by mickey View Post
1. I read some pages and I'm more confused now; I read that search in abinary-tree is O(n) (i.e. create a tree with this elements in input with this order: 10,20,30,40,50 -> O(5) = O(n).
This is the worst case scenario for an unbalanced tree - in the above mentioned case your tree becomes a list. On average the complexity is O(logn) and balancing the tree (see AVL Trees) guarantees O(logn) lookup in the worst case too (the insertion is slower though).

2. If I can obtain a search in OLogn(n) with an sorted array, for clearly, I prefer this....I guess it'll be the same of a sorted vector<int>
Yes, a vector is also an array.