#include #include "list.h" List::List() { length = 0; } bool List::IsEmpty() const{ return(length==0); } bool List::IsFull() const{ return(length==MAX_LENGTH); } int List::Length() const{ return(length); } void List::Insert(ItemType item){ int insert_pos, i; if (length < MAX_LENGTH) { insert_pos = 0; while ((insert_pos < length) && (data[insert_pos] < item)) { insert_pos++; } // we will point to where we want to put the item; // clear out the array for(i=length;i> insert_pos;i--) { data[i] = data[i-1]; } data[insert_pos] = item; length ++; } } void List::Delete(ItemType item){ int del_pos; int i; del_pos = 0; while ((del_pos < length) && (data[del_pos] != item)) { del_pos ++; } if (del_pos < length) { for (i=del_pos;i