0% found this document useful (0 votes)
0 views

Tree_handson[1]

The document outlines the steps to create and manipulate binary search trees by inserting and deleting specified numbers, illustrating the tree structure at each stage. It also includes instructions for constructing expression trees from given mathematical expressions and performing various tree traversals such as pre-order, post-order, and in-order. Each section provides a systematic approach to understanding binary search trees and expression trees.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Tree_handson[1]

The document outlines the steps to create and manipulate binary search trees by inserting and deleting specified numbers, illustrating the tree structure at each stage. It also includes instructions for constructing expression trees from given mathematical expressions and performing various tree traversals such as pre-order, post-order, and in-order. Each section provides a systematic approach to understanding binary search trees and expression trees.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CREATING OF BALANCED BINARY SEARCH

1. Create a binary search tree with the following numbers: 20, 25, 10, 5, 15.
Delete keys 20, 10 and 25 one after the other and show the trees at each
stage.
2. Construct a binary search tree from the numbers: 30, 20, 40, 10, 25, 35, 50.
Delete 20, 40 and 30 one after the other and illustrate the tree at each step.
3. Build a binary search tree using the numbers: 8, 3, 10, 1, 6, 14, 4. Delete keys
1,4,10 and 3 sequentially and show the trees after each deletion.
4. Form a binary search tree with the following values: 12, 7, 9, 15, 18, 3, 5.
Delete keys 9 and 3
5. Create a binary search tree with the following numbers: 45, 25, 65, 15, 35, 55,
75. Delete keys 25 and 65 one after the other and show the trees at each
stage.

Construct expression trees and perform pre-order, post-order and inorder traversals
1. Expression: (x−y)∗(z+(a/b))(x - y)

2. Expression: (r - (s * t))(p+q)/(r−(s∗t))

3. Expression: (m+(n/o))∗(p + n / o))

4. Expression: ((u−v)+w)∗(x+y)((u - v) + w)

5. Expression: (a+(b−c))/((d+e)∗f)(a + (b - c)) / ((d + e)

You might also like