Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming 39 SS 28 12 59 Figure 1: Tree Figure 1 shows a tree that contains twelve nodes. a) i. Trace the errors exist

C programming

image text in transcribed

image text in transcribed

39 SS 28 12 59 Figure 1: Tree Figure 1 shows a tree that contains twelve nodes. a) i. Trace the errors exist in the tree if this tree were subjected to binary tree. (2 Marks) ii. Re-draw the diagram in the figure into a proper binary tree where the root node is 50 and the maximum binary tree in degree is 3. (4 Marks) b) XYZ Company has conducted an interview on 1 October 2017 for several positions in their company. Twelve names have been selected for all the positions and are required to report to the company within one month from the date of the interview. Table 2 shows the list of name, staff ID and their reporting date to the company. Name Ahmad Asyraf Fadilah | Joy Chua Tina Zafril Sharifah Michele Raja Hassan Chuan Jaya Table 2 Staff Id Date of report in 1006 17 October 2017 1009 25 October 2017 1007 19 October 2017 1003 10 October 2017 1001 OS October 2017 1004 13 October 2017 1011 29 October 2017 1002 08 October 2017 1008 23 October 2017 1010 27 October 2017 1005 16 October 2017 1012 31 October 2017 5 i. Using name as the data in the nodes, draw a binary tree based on the given report date in Table 2. (4 Marks) ii. Develop a binary tree program by initializing all the nodes with the staff ID given in Table 2. (10 Marks) Develop a function with appropriate passing parameter to search staff ID in the binary tree. Then, display "staff ID exist" if the value is existing, Otherwise, display "no staff ID". (5 Marks) 39 SS 28 12 59 Figure 1: Tree Figure 1 shows a tree that contains twelve nodes. a) i. Trace the errors exist in the tree if this tree were subjected to binary tree. (2 Marks) ii. Re-draw the diagram in the figure into a proper binary tree where the root node is 50 and the maximum binary tree in degree is 3. (4 Marks) b) XYZ Company has conducted an interview on 1 October 2017 for several positions in their company. Twelve names have been selected for all the positions and are required to report to the company within one month from the date of the interview. Table 2 shows the list of name, staff ID and their reporting date to the company. Name Ahmad Asyraf Fadilah | Joy Chua Tina Zafril Sharifah Michele Raja Hassan Chuan Jaya Table 2 Staff Id Date of report in 1006 17 October 2017 1009 25 October 2017 1007 19 October 2017 1003 10 October 2017 1001 OS October 2017 1004 13 October 2017 1011 29 October 2017 1002 08 October 2017 1008 23 October 2017 1010 27 October 2017 1005 16 October 2017 1012 31 October 2017 5 i. Using name as the data in the nodes, draw a binary tree based on the given report date in Table 2. (4 Marks) ii. Develop a binary tree program by initializing all the nodes with the staff ID given in Table 2. (10 Marks) Develop a function with appropriate passing parameter to search staff ID in the binary tree. Then, display "staff ID exist" if the value is existing, Otherwise, display "no staff ID

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_2

Step: 3

blur-text-image_3

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 Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions