Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE The UnixTM operating system in C programming language Task Suppose your company is establishing a new engineering organization, and you are asked to implement

USE The UnixTM operating system in C programming language
Task
Suppose your company is establishing a new engineering organization, and you are asked to implement a tree data structure to store and retrieve the organization chart information, as well as write code for testing your implementation.
1) Tree operations:
a. Add employees identified along an employee ID path to the organization chart, see below for elaboration and examples.
b. Find an employee in the organization chart based on an employee ID path. c. Count number of employees in the organization chart starting from an employee ID path.
2) Test code (see program execution and required output below):
a. Read an org chart file that has the information of levels and employee ID paths to build an org chart.
b. Read another file containing employee ID paths, and for each employee ID path read, count, and print the number of employees starting from it in the org chart.
THESE ARE THE FOLLOWING TEST FILES:
orgchart.txt:
managerlevels=5
86957
e_0_0_6_4
e_8_5_6
e_7_0_0
e_2_7_1_3
e_1
e_0_8_5_8
e_0_2_1_0_2_1_3
e_0
E_1_2_6
e_2
e_0_5_1_1
e_2_3
e_6_8_5_1_5
e_6_2_3_6_9
e_6_7_8
e_0
E_2_6_5_1_0_0_7
testfile.txt:
e_0_0_6_4
e_8_5_6
e_7_0_0
e_2_7_1_3
e_1
e_0_8_5_8
e_7_4_3_0_3_0
e_0
e_1_2_6
e_2
e_0_5_1_1
e_2_3
e_6_8_5_1_8
e_6_2_3_6_9
e_6_7_8
e_0
e_2_6_5_1_0_0_7
testCorrectOutput:
e_0_0_6_41
e_8_5_60
e_7_0_01
e_2_7_1_30
e_13
e_0_8_5_80
e_7_4_3_0_3_00
e_011
e_1_2_61
e_22
e_0_5_1_11
e_2_31
e_6_8_5_1_80
e_6_2_3_6_90
e_6_7_80
e_011
e_2_6_5_1_0_0_70

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago