Howmany are grater than 50 ?
175,150,120,90,70 ===> 5 elements
note that in BST, if you are accessing a grater value than searching element, then next time you can't visit the node which is grater than the previous visited nodes.
i.e., on searching 50, if you visit 120 first then you can't visit either 150 or 175 in further searches.
( Think Why this is true, if you didn't get take a set of sample elements analyse it. )
So, 175 --> 150 ---> 120 ---> 90 ---> 70 should be visited in the order.
Howmany are less than 50 ?
10,30,40 ===> 3 elements
note that in BST, if you are accessing a lesser value than searching element, then next time you can't visit the node which is less than the previous visited nodes.
i.e., on searching 50, if you visit 40 first then you can't visit either 30 or 10 in further searches.
( Think Why this is true, if you didn't get take a set of sample elements analyse it. )
So, 10 --> 30 ---> 40 should be visited in the order.
Think this are transactions in DBMS, T$_1$ contains 5 and T$_2$ contains 3
Total orders possible = $\frac{(5+3)!}{5!.3!}$ = 56