Question: Extend your program in exam.lua to also do the following: Opens a text file called graph.txt which contains values to be inserted in an AVL

Extend your program in exam.lua to also do the following: Opens a text file called graph.txt which contains values to be inserted in an AVL-tree datastructure in the following formato Value (on a single line)o For example the file defining the tree above contains the following:AEIOUBCDYou may assume that values are single letters and that there are no duplicates Add support for the following two commands to your system:Sub - question DescriptionQ2-A Command: showchildrenParameters: 1 letterBehaviour: The system must read a letter from the standard input stream and output all of thenodes which are children (or grand-children or great grand-children etc.) of that node (in alphabeticorder). If there are no children then None must be output.Expected output on test data with input (B): A C DExpected output on test data with input (C): DExpected output on test data with input (O): I UExpected output on test data with input (A): NoneQ2-B Command: insertParameters: 1 letterBehaviour: The system must read a letter from the standard input stream, insert that value into thetree, restore the AVL property, then output the nodes in the order they would be reached by abreadth first traversalExpected output on test data with input (Z):EB OA C I UD Z

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!