8.12 LAB: Output a linked list Write a recursive function called print_list() that outputs the integer value of each nod

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

8.12 LAB: Output a linked list Write a recursive function called print_list() that outputs the integer value of each nod

Post by answerhappygod »

8.12 LAB: Output a linked list
Write a recursive function called print_list() that outputs theinteger value of each node in a linked list. Function print_list()has one parameter, the head node of a list. The main program readsthe size of the linked list, followed by the values in the list.Assume the linked list has at least 1 node.
Ex: If the input of the program is:
the output of the print_list() function is:
Hint: Output the value of the current node, then call theprint_list() function repeatedly until the end of the list isreached. Refer to the Node class to explore any available instancemethods that can be used for implementing the print_list()function.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply