edited by
145 views
2 votes
2 votes
In a binary search tree, the following key values (not necessarily in the order given) are encountered while searching for the key $24.$
$$1,5,9,13,17,21,25,29,33.$$ The total number of possible orders in which the given keys of the binary search tree could have been visited is _________
edited by

1 Answer

1 votes
1 votes
We have $9$ elements in the search path. Out of these $6$ are lower than $24$ and $3$ are higher than $25$. All the lower elements to $24$ must occur in an order and similarly all the higher elements to $24$ must also occur in an order. So, total possibilities $ = \dfrac{9!}{6!3!} = 84.$
Answer:

Related questions

1 votes
1 votes
1 answer
1