11 Aug DescriptionWrite a void function that takes a linked list o
DescriptionWrite a void function that takes a linked list of integers and interchanges data in the first node with that in the last node. The function will take a pointer to the head of the list. After the function is called, it will retrieve data stored in it, then find and retrieve data stored in the last node. The function will then interchange the data of the first node with that of the last node.Note that your function will neither create nor destroy any nodes. It will simply interchange the data stored between the head and tail nodes. Place your function in a suitable test program.** Please answer all three questions in the Problems Encountered & More sectionGivenYou are given the following file:main.cppWhat to SubmitSubmit for this lab:main.cppRequirementsImplement the exchange_data function in main.cppYou may add more functions that are needed to implement the aboveYour code will not cause any runtime errors such as segmentation faultsAnswer all three questions in the Problems Encountered & More sectionTipsUse visual aids to help you understand your plan for the functionConsider boundary cases, such as:When the list is emptyWhen the list has only one nodeYou might want to ‘rewrite’ or ‘copy/type out’ other functions that are already implemented to solidify your understanding with linked list firstTest CasesSuggestion: Change main.cpp to add more ways to test your reverse function implementation.Demo Just finished adding nodesCurrent linked list:7 5 4 8 9Just finished exchanging dataCurrent linked list:9 5 4 8 7Problems Encountered & MoreIn the end of your main.cpp file, add a blocked comment section as follows and fill it out:/* ==========================================================Q1. Problems I had working on this assignment (and how I overcame these problems)1.2.Q2. When implementing exchange_data, I had passed in head as a parameter:// your answer: by value or referenceQ3. The reason being:// your answer: explain your choice========================================================== */
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteEdu. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
Do you need help with this question?
Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.
WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.
With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Chat with us today! We are always waiting to answer all your questions.