Draw the binary search tree that is created if the following numbers are inserted in the tree in the given order.
12 15 3 35 21 42 14

Solution: (Draw (or print) the BST tree

List of the order of entry =

List the BST inorder traversal value: =

List the BST preorder traversal value =

List the BST postorder traversal value =

Respuesta :

Answer:

1. Binary Search tree is created in word file and attached below.

2. In order Traversal

order is followed as

1. visit Left

2.visit root

3. visit right

so the answer is

3,  12,  14,  15,  21, 35, 42

3. Pre order Traversal

order is followed as

1. visit root

2.visit left

3. visit right

so the answer is

12, 3, 15, 14, 35, 21, 42

4. Post order Traversal

order is followed as

1. visit left

2.visit right

3. visit root

so the answer is

3, 14, 21, 42, 35, 15, 12

Ver imagen l135134

Otras preguntas