Question

In: Computer Science

A certain Professor Amongus claims that the order in which a fixed set of ele- ments...

  1. A certain Professor Amongus claims that the order in which a fixed set of ele- ments is inserted into a binary search tree does not matter—the same tree results every time. Give a small example that proves Professor Amongus wrong.

Solutions

Expert Solution

Solution :-

Basically we assume that all the numbers present in the binary search tree are distinct even if they happen to be same, they are placed in the same position.

Rules to construct a binary search tree :-

1. All the elements that are lesser than the root element will be present in the left side of the root or will be a part of the left child of the root.

2. All the elements that are greater than the root element will be present in the right side of the root or will be a part of the right child of the root.

According to the question, the professor claims that " the order in which a fixed set of elements is inserted into a binary search tree does not matter ".

This claim is not true, because the structure of the binary search tree totally depends on the order in which the elements are inserted in the BST.

Let's look into an example of a binary search tree containing the elements 50, 15, 62, 5, 20, 65.

According to the order let's construct the BST.

Let's enter the node with value 50 first.

Now the value of 15 is less than 50 so it will go to the left of 50.

Let's enter the node of 15.

Now let's enter 62, according to the rule.

After 62, let's enter 5.

Entering 20 this time.

Now, 65.

Here is the final structure of the tree.

If we change the structure of the tree and swap 15 with 20, then the order changes to 50, 20, 62, 5, 15, 65.

We will follow the same insertion rules with insertion of 50 first then 20, then 62, then 5 then 15 and in the end 65.

The final structure of the tree will look like :-

We can observe the two structures that we finally got before and after changing the order of the elements.

We found out that the structure of both the BST are different and hence we can say that the order in which the elements are arranged does matter.


Related Solutions

A professor in the accounting department of a business school claims that there is much more...
A professor in the accounting department of a business school claims that there is much more variability in the final exam scores of students taking the introductory accounting course as a requirement than for students taking the course as part of a major in accounting. Random samples of 16 non-accounting majors (group 1) and 15 accounting majors (group 2) are taken from the professor's class roster in his large lecture, and the following results are computed based on the final...
For fixed order quantity inventory system, which of the following costs is increased when order size...
For fixed order quantity inventory system, which of the following costs is increased when order size (Q) is increased? a) Setup cost b) Ordering cost c) Start-up quality cost d) Insurance cost e) Receiving inspection cost      
An MPH professor claims that 50 % of the students in his class has a median...
An MPH professor claims that 50 % of the students in his class has a median weight different from 140 lb. He collects the weight of a random sample of 22 students. Enter the following data in SPSS and perform a binomial test using the standard method. Alpha level = 0.05 (Make sure to save your data before start analyzing the data). 135 119 106 135 180 108 128 160 143 175 170 205 195 185 182 150 175 190...
A biology professor claims that, on the average, 10% of her students get a grade of...
A biology professor claims that, on the average, 10% of her students get a grade of A, 30% get a B, 40% get a C, 10% get a D, and 10% get an F. The grades of a random sample of 100 students were recorded. The following table presents the results. Grade A B C D F Observed 10 34 46 6 4 Test the hypothesis that the grades follow the distribution claimed by the professor. Use the α =...
A statistics professor claims that the average score on the Final Exam was 83. A group...
A statistics professor claims that the average score on the Final Exam was 83. A group of students believes that the average grade was lower than that. They wish to test the professor's claim at the  α=0.05α=0.05 level of significance. (Round your results to three decimal places) Which would be correct hypotheses for this test? H0:μ=83H0:μ=83, H1:μ≠83H1:μ≠83 H0:μ≠83H0:μ≠83, H1:μ=83H1:μ=83 H0:μ=83H0:μ=83, H1:μ>83H1:μ>83 H0:μ=83H0:μ=83, H1:μ<83H1:μ<83 H0:μ<83H0:μ<83, H1:μ=83H1:μ=83 A random sample of statistics students had the Final Exam scores shown below. Assuming that the...
A math professor claims that the standard deviation of IQ scores of the students majoring in...
A math professor claims that the standard deviation of IQ scores of the students majoring in mathematics is different from 15, where 15 is the standard deviation of IQ scores for the general population. To test his claim, 10 students were surveyed and their IQ scores were recorded. 120, 110, 113, 123, 119, 160, 220, 119, 110, 140 Test the professor’s claim using a 0.01 level of significance.
Which of the following is true? Group of answer choices The DNA genome is fixed (set...
Which of the following is true? Group of answer choices The DNA genome is fixed (set and unchanging); the epigenome is modifiable during an individual's life The DNA genome is fixed (set and unchanging); the epigenome is fixed (set and unchanging) during an individual's life The DNA genome is modifialbe; the epigenome is modifiable during an individual's life The DNA genome is modifiable; the epigenome is fixed (set and unchanging) during an individual's life What is the epigenome? Group of...
A professor in the school of business at a certain university wants to investigate the claim...
A professor in the school of business at a certain university wants to investigate the claim that the prices of new textbooks in the campus store are higher than a competing national online bookstore by more than 50 cents. The professor randomly chooses required texts for 12 business school courses. Use α=0.05α=0.05. The data is given in the table below. Book Campus Store Online Store A 108.51 109.42 B 200.06 201.93 C 223.52 226.39 D 186.12 183.9 E 121.65 122.13...
A professor in the school of business at a certain university wants to investigate the claim...
A professor in the school of business at a certain university wants to investigate the claim that the prices of new textbooks in the campus store are higher than a competing national online bookstore. The professor randomly chooses required texts for 12 business school courses. The data is given in the table below. Book Number Campus Store Online Store Book 1 125.45 124.27 Book 2 88.37 86.21 Book 3 230.98 229.6 Book 4 151.8 153.02 Book 5 236.44 237.4 Book...
A professor in the school of business at a certain university wants to investigate the claim...
A professor in the school of business at a certain university wants to investigate the claim that the prices of new textbooks in the campus store are higher than a competing national online bookstore by more than 50 cents. The professor randomly chooses required texts for 12 business school courses. Use α=0.05 . The data is given in the table below. Book Campus Store Online Store A 171.79 171.56 B 155.76 154.72 C 108.11 106.57 D 161.67 156.68 E 151.47...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT