CS201 Final Problems.
                               Tree 1
Binary Tree

How can we store tree 1?
      Root=                Avail=

0

10

1

15

2

20

3

40

4

30

5

80

6

60

7

70

8

90

9

75

10

65

11

12

13

Draw this tree.(Tree 2)
Root= 4                Avail=9

0

30

-1

-1

1

20

6

0

2

50

-1

-1

3

60

-1

-1

4

40

1

7

5

90

-1

-1

6

10

-1

-1

7

55

2

8

8

85

3

5

9

10

10

11

11

12

12

13

13

-1

Draw this tree.(Tree 3)
Root= 5                Avail=9

0

30

-1

-1

1

20

-1

-1

2

50

-1

-1

3

60

7

2

4

40

-1

-1

5

90

8

3

6

10

-1

-1

7

55

1

0

8

85

6

4

9

10

10

11

11

12

12

13

13

-1

 

Add 35 to tree1, make sure that the tree retains in property.

Is Tree 2 a binary search tree or a heap?



Perform an inorder tranversal of  tree 2.



Using the chart for Tree 2, add 45 to this tree. Make sure That the tree retains its property and that the tree is balanced

Is Tree 3 a binary search tree or a heap?



Perform a post order tranversal of  tree 3.



Using the chart for Tree 3, add 45 to this tree. Make sureThat the tree retains its property and that the tree is balanced