HOMEWORK PROBLEM 10 INTRODUCTION TO Ada 95 PURPOSE: To learn about access types Binary trees are used because they rather naturally dictate the use of access types. END RESULT: A complete Ada program that is a main procedure that WITH's a package containing the binary tree manipulation routines INSERT, FIND, DELETE and OUTPUT. Use OUTPUT as a debugging aid as each feature is added. PROBLEM: Use the attached samples as a guide to write a package that has binary tree manipulation routines. You must add a procedure DELETE that takes a name and deletes the names node from the tree. You can build the same tree. To show that the cases work delete ( in order ) "E " , "B " , and "D " . Make provision for doing nothing to the tree if the name is not in the tree. Output the tree after every delete. TURN IN: Printout main procedure and package. Printout of execution for built in test data. OBSERVE: These tree manipulation routines are messy if recursive procedures and functions are not used. These happen to be in the class of "simple" recursive routines that can be thoroughly tested to be sure they terminate. READING : ISO 8652:1995 3.10 plus use the index for all references to "access" Barnes 10.1, 10.2, 10.4 EXTRA : For extra credit make the INSERT and DELETE work to maintain a balanced binary tree. This uses the balance factor BF. The INSERT is not too difficult but the DELETE is a bear! It turns out that just plain binary trees are very inefficient. But, balanced binary trees are very efficient. If the tree is maintained in balanced form at most O(log2 N) searches are needed for an INSERT, FIND or DELETE. On a Baltimore phone book N is a large number! An unbalanced tree could be the worse possible structure if the names were entered alphabetically. Zzepth could be all day looking for his phone number. FILES: The starter file is hw10.ada and for gnat hw10.bat. The file can be obtained by ftp from sigpro.md.essd.northgrum.com/pub/ada95 or from ECLUS::DISK2[ADA.ADA95} or on disk from instructor