Lab ListLinkedList - List ADT implemented with linked list

The partial source code for this lab is at http://vpl.ccom.uprp.edu.

You are given an implementation of the integer list ADT using linked list and a client. Since VPL does not (yet) allow for C++ multifile projects, all the code is in the linkedListAll.cpp source code file.

Your task is to complete the implementation of the following member functions:

  1. bool isSorted(): determines if the list is sorted in ascending order. For example, if the list L currrently contains (4, 9, 20) then L.isSorted() returns true. Your algorithm should be worst case O(n) where n is the length of the list.

  2. void insertInOrder(ElementType val): given an integer val and assuming the list is already sorted in ascending order, this function will insert val into the list, conserving its ascending order. For example, if L contains (4, 9, 20) then after L.insertInOrder(15) the list L contains `(4, 9, 15, 20). This algorithm should also be worst case O(n) where n is the length of the list.

  3. LList merge(const LList & b) const: given a second list (that is in ascending order), this function returns a third (ordered) list with the elements of the invoking list and the argument list. For example, if L contains (4, 9, 20) and M contains (10, 23) then L.merge(M) returns a list that contains (4, 9, 10, 20, 23). This algorithm should also be worst case O(n) where the length of each list is n.

The provided client takes care of asking the user for a command and then invoking the corresponding function. The client understands the following commands:

Please include the name of the programmers at the beginning of the file. Also provide comments before each of the functions. You should follow good programming practices such as: