you are given the following four files defining a simple linked list class calle
ID: 667198 • Letter: Y
Question
you are given the following four files defining a simple linked list class called IntegerList: IntegerList.h, IntegerList.cpp, IntListNode.h and IntListNode.cpp. There is also a file called test.cpp that allows testing of this list containing integers. An IntegerList object contains one pointer pointing to the first or front node of the linked list. An IntListNode object contains an integer and a pointer to another IntListNode object following it. The main function in test.cpp allows you to insert integers at the front of the list and to print all integers in it.
Add a member function to the class IntegerList called AddAtPosition that takes as parameters an integer to be placed in the list and a number indicating the position where the new integer should be inserted. IntegerList.h has the member function heading in the public part of IntegerList. All you need to do is to add the member function declaration (the body of the member function).
the files are not included. However, based on the description of the problem, you should be able to create a simple linked list class and complete the program.
Explanation / Answer
IntegerNode.h
IntegerNode.cpp
IntegerList.h
IntegerList.cpp
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.