Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the number of ways in which the numbers 1,2,3,4,5,6,7 can be inserted in an empty Binary search tree is such that the resulting tree has

the number of ways in which the numbers 1,2,3,4,5,6,7 can be inserted in an empty Binary search tree is such that the resulting tree has a height 6, is ____? Note: the height of a tree w/ a single node is 0"

the answer is 2^6 = 64.

the reasoning is: "

For height 6, we have 2 choices. Either we select the root as 1 or 7. Suppose we select 7. Now, we have 6 nodes and remaining height = 5. So, now we have 2 ways to select root for this sub-tree also. Now, we keep on repeating the same procedure till remaining height = 1 For this last case also, we have 2 ways. Therefore, total number of ways = 2^6= 64"

my problem is: this is how i understand it: 1 or 7 is chosen as a root and all others are added after it making a structure tht looks like a straight line, because the height must be 6. but from my understanding, this would not give choice. so i don't understand how there is a choice of two after the root?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. What are the key intersections across your network?

Answered: 1 week ago

Question

=+j on to staff their operations in the global marketplace.

Answered: 1 week ago