607 views
0 votes
0 votes
When searching for the key value 50 in the binary search tree, node containing the key values 10,30,40,70,90,120,150,175 are traversed in any order.The number of different orders possible in which these keys values can occur on the search path from root to the node containing the value 50 are?

1 Answer

0 votes
0 votes

See this is same as combinatrics problem of a bot moving from (0,0) to (n,n) in either moving right or up,likewise here 10,30,40 and 175,150,120,90,70 should be in this order always before reaching 50

so no of ways= picking slots for 10,30,40 in 3ways among 8 places before reaching 50, making 8!/(3!*5!)=56

Related questions

1 votes
1 votes
1 answer
1
rahul sharma 5 asked Apr 12, 2018
662 views
a:) If given Tree is BST = Inorder of keys is sortedb:) Inorder of keys is sorted = Tree is BST(converse of above)I know first one holds.Is second one also true?If not ca...
1 votes
1 votes
2 answers
2
rahul sharma 5 asked Oct 6, 2017
779 views
What is the time complexity to delete the root node in right skew tree?I knew the three cases of BST deletion:- 0 child,one child,two child.But how can we handle this par...
2 votes
2 votes
1 answer
3
rahul sharma 5 asked Oct 2, 2017
439 views
What is the worst case time complexity to construct unique BST froma:) Inorder and preordera:) Inorder and postorder
1 votes
1 votes
1 answer
4
s_dr_13 asked Mar 10, 2019
2,565 views
Consider the following binary tree with root at level 0. What is the internal path length for the above tree?31142932