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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started