Define two struct objects as follows: elementType struct that contains four members variables, an integer, a float, a ch

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Define two struct objects as follows: elementType struct that contains four members variables, an integer, a float, a ch

Post by answerhappygod »

Define two struct objects as follows:
elementType struct that contains four members variables,
an integer, a float, a char, and
a bool.
nodeType struct that contains
an elementType object called data and
a nodeType pointer called link.
Add the two struct object definitions to
an ObjectHeader.h file. The header file should
contain ONLY the struct object definitions above. Take a
snapshot (screenshot) of the file.
/*PASTE SCREENSHOT HERE*/
Write the driver function definition for a function
called findKthNode that takes as its parameters the
linked list (nodeType pointer) and an integer value. The
function should find the reference to the kth node and return
the integer position of the node to the calling function. If the
kth node does not exist, the function should return
a -1.
/*PASTE CODE HERE*/ 
Write the driver function definition for a function
called deleteKthNode that takes as its parameters the
linked list reference (nodeType pointer reference) and an
integer value. The function should find and delete the kth node in
the list. If the kth node does not exist, the function should print
a message saying "The kth node does not exist in this
list".
/*PASTE CODE HERE*/ 
Write a driver function called size that takes as its
parameter a linked list (nodeType pointer). The function
should count how many nodes are in the list and return that value
to the calling function.
/*PASTE CODE HERE*/ 
Given the code created during lecture (Handout section, page "In
class activity -- Linked lists"), add the functions defined above
to the program. Test the new program with the dataset provided
below. Attach the screenshot of a complete run of the program
below (Hint: Use the snipping tool to take
screenshots):
Dataset: 54 98 44 65 25 45 33 95 31 65 13 74
6
/*PASTE SCREENSHOT HERE*/
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply