Do the find and add operations on a binary search tree always require at most O(log 2 n) comparisons? If so, why? If not, why not?

What will be an ideal response?


The answer is ‘no’. If the tree is degenerate, meaning highly unbalanced, then a find or an add operation may
require more than O(log 2 n) comparisons. In the worst case, these operations will require a linear number (O(n)) of
comparisons.

Computer Science & Information Technology

You might also like to view...

Match the following terms to their meanings:

I. The value axis A compares two or more sets of data in one chart II. A single data series chart B. is a key that identifies the color, gradient, picture, texture, or pattern fill assigned to each data series in a chart III. A multiple data series chart C. displays incremental values to identify the values of the data series IV. A clustered column chart D. compares values for one set of data V. A legend E. groups or clusters similar data in columns to compare values across categories

Computer Science & Information Technology

In Section 24.5.1 when discussing naming transparency, we proposed the use of aliases to uniquely identify each replica of each fragment. Provide an outline design for the implementation of this approach to naming transparency.

What will be an ideal response?

Computer Science & Information Technology

An object is a(n) ____ data structure.

A. inherited B. derived C. homogeneous D. heterogeneous

Computer Science & Information Technology

Which of the following is an application that appears to be benign but actually performs a malicious activity?

a. Virus b. Spyware c. Trojan d. Worm

Computer Science & Information Technology