(C++) You are to create a binary tree that contains information about pets. A pet struct has already been defined: struc

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

(C++) You are to create a binary tree that contains information about pets. A pet struct has already been defined: struc

Post by answerhappygod »

(C++) You are to create a binary tree that contains information
about pets. A pet struct has already been defined:
struct pet
{ string name;
string species;
int weight;
int number_of_legs; };
a: Define a class to represent a binary tree of pointers to
pets. Give it a constructor that creates an empty tree.
b: Define a method that adds a new pet to the tree. Pets are to
be stored in alphabetical order based on their names.
c: define a method that prints the name, species, and weight of
every pet in the tree, in alphabetical order.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply