I have read up on red black trees, and I understand that they try to solve the problem of the tree becoming unbalanced. However, what if you were to use randomized insertion. For example:
Consider the following sorted numbers that need to be inserted:
1,2,3,4,5,6,7,8,9,10
If we naively inserted into a BST the tree would look like: 1 2 3 ..
In this case the tree will be super unbalanced and searching would be linear O(N)
However, if we randomized the insertion, it may look more balanced (but probably not balanced as a red black tree in the average case?) . If we used a red black tree, it'll guarantee a near balanced BST but with a bit of overhead. When does one draw the line of wanting this extra overhead for efficiency vs using randomized insertion BST besides for "online algorithms"( self balancing binary search trees )