Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 3 . 8 LAB: Ordered lists An OrderedList is a vector that keeps elements in sorted order. Complete template class OrderedList by defining the

13.8 LAB: Ordered lists
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 Find(TheType value)
Return the index of the first element in the list equal to parameter value.
Return -1 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions