Question: You are going to build a binary search tree to organize book information. The book information consists of a title, author, and year of publication.
You are going to build a binary search tree to organize book information. The book information consists of a title, author, and year of publication. The tree will be initialized by reading in the information from a file. The information is line oriented and will consist of the name of the book, the author (last name first), and the year of publication. Once your tree is built you are to do an inorder traversal and print out all of the information. To test the tree you are to do a series of searches by book title. The search strings will also be line oriented and come from a file. You are to keep report on whether each title is found and how many comparisons were required to find it. If a node is not found you should still be reporting on the number of comparisons required to come to this decision.
The input file will be named books.txt and will contain the information as described. A sample file will be posted with this project. The search file will be named searches.txt and a sample will also be posted with this file.
Work in small parts. Build the tree first and see that searches work. Start small. A single node should be easy to test.
C++ plz
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
