[Solved] SOLVED: Homework 3 Solution

$25

File Name: SOLVED:_Homework_3_Solution.zip
File Size: 254.34 KB

SKU: [Solved] SOLVED: Homework 3 Solution Category: Tag:
5/5 - (1 vote)

In this assignment you will create two separate programs (avltree and btree) that have a common theme: to read a file containing ASCII text of names of people. The file name should be specified on the command line as an argument. Each line should contain a name.Billy BobJohnny SueSarahEach line is considered to only contain a single name (spaces and other ASCII characters are considered valid for that name). i.e. each line can be considered to be unique and no parsing is required.1. (50 Points) The program should build an AVL Tree from this input. The program would be run as:avltree filename.txtAfter the file is read and the tree is constructed, the program should accept user input (case insensitive):a. PRINTi. Prints all names in tree using a breadth first approach. Each name should be printed on a separate line.b. HEIGHTi. Prints the maximum height of the tree.c. FINDi. Finds the name, and prints the name followed by the balance factor of the node containing the name. The name and the balance factor should be separated by a comma. Right sub-tree heights are always positive.Sarah, 12. (50 Points) This program should build a B-Tree from this input. This program should also accept the order of the B-Tree as the second argument. The program would be run as:btree filename.txt 4The tree would construct an order 4 B-tree. After the file is read and the tree is constructed, the program should accept user input (case insensitive):a. PRINTi. Prints all names in tree using a depth first approach (i.e. all the names should be printed in alphabetical order). Each name should be printed on a separate line.b. HEIGHTi. Prints the maximum height of the treec. FINDi. Finds the name, and prints any names contained in the tree node. Names should be displayed on separate lines and in order.Johnny Sue Sarah Tom

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED: Homework 3 Solution
$25