Question: 1 3 . 8 LAB: Ordered lists NEED IN C + + ( PLEASE DO NOT PUT THE ANSWER IN THE CODE, IF THERE IS
LAB: Ordered lists NEED IN CPLEASE DO NOT PUT THE ANSWER IN THE CODE, IF THERE IS NUMBERS IN THE CODE IT DOES NOT WORK for example was removed correctly" WILL NOT WORK, PLEASE MAKE THE CODE WORK WITHOUT NEEDING THAT
please do this with variables so that multiple imputs will work, I have tried fixing the code I made but it keeps giving errors, please solve this code thanks
An OrderedList is a vector that keeps elements in sorted order.
Complete template class OrderedList by defining the following functions:
int Size
Return the size of the list
TheType Atint index
Return the element of the list at parameter index.
int FindTheType value
Return the index of the first element in the list equal to parameter value.Return if parameter value is not found in the list.
bool RemoveTheType value
Search the list for parameter value. Hint: Use FindIf parameter value is found in the list, remove the element found by moving the subsequent elements towards the beginning of the list. Decrement list size and return true.Return false if parameter value is not found in the list.
Hint: Use any vector functions to simplify the implementations.
The template code provides the implementations of the following functions:
void InsertTheType value
Search the list for an element that is greater than parameter value.If an element is found, increment list size and move the element and all subsequent elements towards the end of the list to make room for parameter value. Copy parameter value at the location that was occupied by the first element greater than parameter value.If no such element is found, increment list size and add parameter value at the end of the list.
void Print
Output the list, separated by a space character.
A main program is provided as a sample test in the develop mode. Unit tests will be used during a submission.
Ex: if the given main is executed, the output of the program is
Size is correct List is in correct order: Index of is correct was removed correctly
An OrderedList is a vector that keeps elements in sorted order.
Complete template class orderedList by defining the following functions:
int Size
Return the size of the list
TheType At int index
Return the element of the list at parameter index.
int FindTheType value
Return the index of the first element in the list equal to parameter value.
Return if parameter value is not found in the list.
bool Remove TheType value
Search the list for parameter value. Hint: Use Find
If parameter value is found in the list, remove the element found by moving the subsequent elements towards the beginning
of the list. Decrement list size and return true.
Return false if parameter value is not found in the list.
Hint: Use any vector functions to simplify the implementations.
The template code provides the implementations of the following functions:
void Insert TheType value
Search the list for an element that is greater than parameter value.
If an element is found, increment list size and move the element and all subsequent elements towards the end of the list to
make room for parameter value. Copy parameter value at the location that was occupied by the first element greater than
parameter value.
If no such element is found, increment list size and add parameter value at the end of the list.
void Print
Output the list, separated by a space character.
A main program is provided as a sample test in the develop mode. Unit tests will be used during a submission.
Ex: if the given main is executed, the output of the program is
Size is correct
List is in correct order:
Index of is correct
mathrm was removed correctly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
