Question: Write a complete C++ class, class IntegerLinkedList, to store integers in a singly linked list and compute a function of the elements in the linked
Write a complete C++ class, class IntegerLinkedList, to store integers in a singly linked list and compute a function of the elements in the linked list. Class IntegerLinkedList needs to have only two public member functions:
void addFront (int n) // insert n to the head of the linked list.
bool isAscending ( ) : return true if integers starting from the head are in ascending/increasing order (i.e., arranged smallest to largest); false otherwise.
A sample run is shown below (with the corresponding linked list):
Enter number of integers : 7
Enter 5 integers: 78 62 41 34 14 11 3
isAscending: 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
