Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using inheritance, extend the template class indexList (posted on UR Courses) with the following functions: Concatenate two indexed lists. Sort an indexed list using the

Using inheritance, extend the template class indexList (posted on UR Courses) with the following functions:

Concatenate two indexed lists.

Sort an indexed list using the selection sort algorithm (declared in indexList but not implemented).

Find the position of a target using the binary search algorithm.

Write a driver program that will create two indexed lists of integers, concatenate the two lists, sort the resulting list and then display it. In addition, the driver will search for a target in the resulting list.

image text in transcribed

Hand In

1. The header, implementation and driver programs should be respectively named : IndexList.h, IndexList.cpp, ExtIndexList.h, ExtIndexList.cpp and TestExtIndexList.cpp. In the class indexList, include only the required member functions.

2. Your C++ programs SHOULD compile using CC (Sun compiler) under Hercules.

A sample run follows List 1 of type "int" Enter number of list items: 4 Enter next item: 11 Enter next item Enter next item: 5 Enter next item: 34 List 2 of type "int" Enter number of list items: 3 Enter next item: 0 Enter next item: 2 Enter next item: 49 List 3: List 1 concatenated to List 2 11, 7, 5, 34, 0, 2, 49 List 3 sorted in ascending order 0, 2, 5, 7, 11, 34, 49 Enter the number to search in List 3: 11 11 is at position 5

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago

Question

1. Communicating courses and programs to employees.

Answered: 1 week ago

Question

6. Testing equipment that will be used in instruction.

Answered: 1 week ago