Question: Please code in C++ (4) Based on Problem P13.10 Write a program that reads a list of strings (a string per line) from the file

Please code in C++ Please code in C++ (4) Based on Problem P13.10 Write a programthat reads a list of strings (a string per line) from the

(4) Based on Problem P13.10 Write a program that reads a list of strings (a string per line) from the file data4.txt and inserts them into a binary search tree. You can use the implementation of the class BinarySearchTree introduced in the textbook. Implement a traversal function void inorder (Action&a) for inorder traversal of a binary search tree that carries out an action other than just printing the node data. The action should be supplied as a derived class of the class class Action ( public: void act (string str) ) . Use the inorder function, and a suitable class derived from Action, to compute the sum of all lengths of the strings stored in a tree and then display it * Similarly, implement traversal functions preorder (Action & a) and postorder (Action &a)

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!