Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 You are given the following struct kid and an array of struct kids for a nursery school. You use it for storing The

image text in transcribed

QUESTION 1 You are given the following struct kid and an array of struct kids for a nursery school. You use it for storing The figure on the right shows an example where four kids information has been stored in the array. Mar female kids #define asize 100 typedef enum male e, female gender struct kidf Max male char nane [16]; sender genderValue; int age Seth struct kid kids[asize nt tail- II array of structs Moll Eemale tail All the write-in questions are related to each other and are based on the code given above. Assume that you have all the helper code needed to make the program running. Answer the following questions 1.1 How many padding bits are required for the struct kid? 1.2 Which statement will correctly input the name into the struct array kids? 1.3 Which instruction will correctly input the age into the struct array kids? 1.4 If you want to define struct kidNode based on struct kid, so that kidNode can be used for forming a linked list, what member needs to be added into kidNode? 1.5 What is the total size (in Bytes) of the array kids? QUESTION 2 9 points The structure def nition of this question is based on the previous question. You want to write a function void fromArrayTolinkedLis) to move (copy) all the data in the kids array into the linked list consisting of kidNade strucs. The linked is painted to by the pointer head. You can simply insert the new node into the first place of the linked list, as shown in the example in the following diagram You must use a loop to read each element of data stored in the array from the beginning to the tail and insert the data into the linked list one by one head fers tal The first part of the code is given as follows // In the tunction, you can access tail to the array and head to the linked 11st void frc ArrayoLinkedList

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions