Implement the array based sorted integer list below in ascending order. class myList{ // sorted integer list class int *ptr; // storage body int size; // storage size int length; // length of list public: myList(int); // constructor ~myList(){free(ptr);} // destructor bool empty(){return length==0;} // empty or not bool full(){return length==size;}
- Implement the array based sorted integer list below in ascending order. class myList{ // sorted integer list class
int *ptr; // storage body
int size; // storage size
int length; // length of list
public:
myList(int); // constructor
~myList(){free(ptr);} // destructor
bool empty(){return length==0;} // empty or not
bool full(){return length==size;} // full or not
int length(){return length;} // get length
void insert(int); // insert a value in ascending order
int get(); // get a value from head
};
Step by step
Solved in 2 steps with 3 images