One problem with the binary tree sort is that the order in which the data is inserted affects the shape of the tree—for the same collection of data, different orderings can yield binary trees of dramatically different shapes. The performance of the binary tree sorting and searching algorithms is sensitive to the shape of the binary tree. What shape would a binary tree have if its data were inserted in increasing order? in decreasing order? What shape should the tree have to achieve maximal searching performance?
What will be an ideal response?
If the data were inserted in increasing or decreasing order, the tree would consist of only right children or only left children, respectively. Essentially, the tree would be a sorted linked list. To achieve maximum performance, the depth of the tree should be minimized—in other words, all non-leaf nodes except for the last row should have two children.
You might also like to view...
Which of the tasks is the Join function used to carry out in the following statement? Dim line As String line = Join(strArrData, ",")Which of the tasks is the Join function used to carry out in the following statement?
```Dim line As String line = Join(strArrData, ",") ``` (A) Join concatenates the values of all elements of the array strArrData, and adds a comma delimiter between successive values. (B) Join concatenates the values of all elements of line, and adds a comma to the end of the line. (C) Join parses or separates out all items of text that are delimited by a comma in strArrData. (D) Join parses or separates out all items of text that are delimited by a comma in line.
You can set slide timings by clicking the Advance Slide After checkbox and keying a timing in seconds in the Advance Slide After text box on the ____________________ tab.
Fill in the blank(s) with the appropriate word(s).