   Chapter 10.5, Problem 21ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# In 21-25, use the steps of Algorithm 10.5.1 to build binary search trees. Use numerical order in 21 and alphabetical order in 22—25. In parts (a) and (b) of 21 and 22, the elements in the lists are the same, but the trees are different because the lists are ordered differently. 21. a. 16, 24, 21, 3, 18, 9, 7 b. 16, 7, 3, 21, 18, 24, 9

To determine

(a)

The construction of the binary search tree.

Explanation

Given information:

Keys for a binary search tree is given as,

16,24,21,3,18,9,7

Calculation:

According to the algorithm given in 10.5.1 ,

Before adding a new key search it’s correct position by going left if it is lesser than the current node else go right.

Once we are at the correct position add the key to its parent node.

Above is the binary search tree which is build using the given algorithm with the given keys

To determine

(b)

The construction of the binary search tree.

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 