Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

4. [4 marks] Evaluate the integral (x + 2)10

Answered: 1 week ago