retagged by
681 views
2 votes
2 votes
When searching for the key value 50 in a 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 passing in which these keys values can occur on the search path from the root to node containing the value 50 are ________.
retagged by

1 Answer

Best answer
2 votes
2 votes

This qs has been answered many times.look u have 3 nodes in the left side of 50 and 5 nodes in the right side. U can traverse all the nodes in 8! Way. In which we can traverse left side in 3! Way Right side 5!.

Total no of ways = 8!/(5! *3!) = 56

Basically the problem lies in combinatory.

Ref: https://gateoverflow.in/3462/gate2007-it_29

selected by

Related questions

1 votes
1 votes
0 answers
1
Rohit Gupta 8 asked Dec 25, 2017
1,141 views
If the average depth of a node in an $n$-node binary search tree is $O(\log{n})$, then the height of the tree is$O(n\log{n})$$O(n)$$O(\log{n})$$O(\sqrt(n\log{n}))$
0 votes
0 votes
1 answer
2
monali asked Jan 11, 2016
796 views
2 votes
2 votes
1 answer
4
vijaycs asked May 25, 2016
12,812 views