Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part I: written exercises. 1. Begin with the following binary search tree, draw the BST that results after the operation or sequence of operations is

Part I: written exercises.

1. Begin with the following binary search tree, draw the BST that results after the operation or sequence of operations is performed. (All questions are independent and each question starts from the BST as following) 60 / \ 38 75 / \ / \ 14 48 68 91 / \ \ \ 3 22 54 70 / 51

a. How many leaves are in the tree? b. What is the height of node 38? What is the depth of 54? What is the height of the tree? c. Insert 20, 10, 65, 42, and 94 d. Delete 48, 75, and 22 (based on the original figure, NOT on c). e. Insert 45, delete 48, insert 59, delete 75, insert 94, delete 91 (based on the original figure, NOT on d).

2. For the infix arithmetic expressions below, draw a binary tree that represents the expression, and then use tree traversals to find the equivalent prefix and postfix expressions. a. (A-B)-(C+D) b. (A/ B)-(((C-D)-E)-F) c. ((A*B*C)-(D-E*F))/((G-H)*(I+J)) 3. Construct the Huffman tree and show the encoding for the some words and weights given in the following table. Words Weight a 5,000 b 2,000 c 10,000 d 8,000 e 22,000 f 49,000 g 4,000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions