#ifndef SORTED_LIST_H #define SORTED_LIST_H #include "Node.h" #include "ListReader.h" /** * This is a somewhat artificial class, designed specifically to * support the 'merge' assignment. It provides a doubly-linked * list of integers, with very limited functionality. */ class SortedList { public: NodePtr header; // head of list sentinel NodePtr trailer; // head of list sentinel /** * A constructor. Rather than creating an empty list, this builds a * new list based upon input from cin (with the convention as * outlined in the assignment statement) */ SortedList() { ListReader::buildList(*this); } /** * Removes all elements from list 'that' merging the nodes into the * current list 'this', while maintaiing the invariant that the * elements are sorted. */ void merge(SortedList* that); }; #endif