Question: Tree operations Implement the following tree operations with the specified logic ( Return type and function name can vary, but pay attention to the requirements

Tree operations
Implement the following tree operations with the specified logic (Return type and function
name can vary, but pay attention to the requirements below):
First, using iterative or recursive implementation is your choice.
bool addEmployees(const char *employeeIDPath);
o You are required to use const char* for the employee ID path argument, you
need to use C string manipulation to parse and extract information from the
employeeIDPath.
You must not use std::string for parsing this argument in the function.
Violating this requirement would result in a 50% deduction of your a1
grade.
You may use std::string in other contexts of your program, e.g., at the
end of the Appendix (see below), std::string is used for reading in lines
from a text file.
o Note this signature is for a member function in a C++ node class; if you are
using C, you would need to add an argument for specifying which node to start
with, e.g.:
bool addEmployees(struct EmployeeNode *curNode, const char *
employeeIDPath);
Similarly, this applies to other functions below.
o Logic:
Starting from the current node, insert employee nodes identified along
the employee ID Path to the tree, stop if the employeeIDPath cannot
be parsed further due to bad format or reaching the end of the path
or reaching beyond the total number of levels specified from the file
for building the org chart (see below the orgchart.txt file).
Inserting an employee node at a child location of a node is to create a
new employee node and assign the newly created node to the lo

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!