Problem 2 Draw the following binary tree. Where the integer is the key and the decimal is the data: (40, 1.2), (20, 2.3), (10, 3.4), (16, 5.6), (13, 5.2), (30, 4.3), (25, 6.7), (18, -7.6), (28, 7.6), (14, 4.2), (35, 6.8), (26, -4.6), (8, -7.1), (22,-9.1) 1- Is the tree balanced? 2- Insert nodes (4, -2.9) and (32, -8.9) 3- Is the subtree rooted at node 20 (obtained in question 2) balanced? Explain. 4-Show the inOder, pre-Order and post-Order traversal of the tree (obtained in question 2). 5- delete nodes (16, -7.6) and (30, -9.1) (using the largest on the left if any) 6- If you had a reference to node (30, 2.3), what would be the Java code that would allow you to delete the node 30 in question 6 (i.e. What is the Java code that would allow you to perform operations you performed in question 6 when deleting node 30).

Q&A Education