Get familiar with the linked lists

Create a function that will print a list out, given the header node. Here is the function header:

void list_print(node * head_ptr)

Place this function before the main function in your program.

  • The function should print out the elements in the list separated by spaces all on one line
  • The function should print an end of line after the list data is printed.

Carry out the following steps in the program, that is, in the function main

  • Create a list header and insert the following data in order: 23.5, 45.6, 67.7, 89.8, 12.9
  • Print out the list using the function you wrote
  • Create a list with two pointers, one to the head and one to the tail.
  • Insert 23.5 into the list (Somewhere in the middle).
  • Then insert these elements in order at the tail of the list: 45.6, 67.7, -123.5, 89.9 and 12.
  • Print the list

You can refer to the code provided for the node class

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.