Question: This is one question with multiple steps (a-f) a. Use the skeleton C/C++ code discussed in class to create the following tree data structure: Root

This is one question with multiple steps (a-f)
a. Use the skeleton C/C++ code discussed in class to create the following tree data structure: Root US BIN HOME Bm HW Projects Grades Drophon OneDrive b. Write the code for visiting the Tree nodes using a preorder traversal algorithm. C. Can you update the preorder traversal function in part b to print the depth of each node visited? d. Write the code for visiting the tree nodes using a post order traversal algorithm.|| e. Assume that the tree represents a directory system. Add to the structure representing the tree node an integer member representing the number of files in each tree node. Update the tree implementation by reinitializing the tree nodes with a particular number of files as presented in the figure below: Root USR 10 HOME BN 15 HW. 7 Projects is Grades 3 . Drive 0 4 Dropbox OneDrive f Use post order traversal to calculate the total number of files in the directory structure at the root node. Hint: While coding the post order traversal, you should sum the different number of files at the children nodes to come up with the total number of files when reaching the root node. a. Use the skeleton C/C++ code discussed in class to create the following tree data structure: Root US BIN HOME Bm HW Projects Grades Drophon OneDrive b. Write the code for visiting the Tree nodes using a preorder traversal algorithm. C. Can you update the preorder traversal function in part b to print the depth of each node visited? d. Write the code for visiting the tree nodes using a post order traversal algorithm.|| e. Assume that the tree represents a directory system. Add to the structure representing the tree node an integer member representing the number of files in each tree node. Update the tree implementation by reinitializing the tree nodes with a particular number of files as presented in the figure below: Root USR 10 HOME BN 15 HW. 7 Projects is Grades 3 . Drive 0 4 Dropbox OneDrive f Use post order traversal to calculate the total number of files in the directory structure at the root node. Hint: While coding the post order traversal, you should sum the different number of files at the children nodes to come up with the total number of files when reaching the root node
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
