Singly-Linked Lists insert_back and isIncreasing
- by rezivor
I just finished writing a program that I can add, remove or print objects to a list, but I am having difficulty implementing two more functions
that is insert_back, which inserts a value to the end of a list. Also,I have to modify the representation of a List and alter whatever methods are necessary to make insert_back run in constant time: O(1).
This new operation should have the signature:
void List::insert_back( const Object& data );
Also, isIncreasing, For example, for a list containing head-() (11) (8) (15) (3), isIncreasing() should return false. However, it would return true when working on a list containing head- () (7) (9) (15).
This new operation should have the signature:
bool List::isIncreasing() const;
Thank you