Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code in C++ for the following questions: Task 1: Modify the implementation of sorted list and implement binary search in insert and delete function.

Write code inC++for the following questions:

Task 1:Modify the implementation of sorted list and implement binary search in insert and delete function. In insert function, binary search should be used to find the appropriate position of the item to be inserted and in the delete function, binary search should be used to find the item that is to be deleted.

To test whether your code works, create a sorted list, insert a few items and then print the list.

Task 2:In this task you need to implement an unsorted list for StudentInfo class. Completing the following sub-tasks will help you to solve this task easily.

a)Create a StudentInfo class that has Name, ID and CGPA as private properties. It should have constructor function(s) and any other necessary functions that are needed to modify and access the properties. You should also implement a Print function that prints the values of the properties of a StudentInfo object.

b)Now modify the implementation of unsorted list (you may choose to implement from scratch if you want) so that it is no longer a class template. Instead it should work only with StudentInfo objects.

c)It would be convenient to be able to search for a student with his/her ID. Therefore, you should implement the delete and retrieve function in such a way that they can operate with student ID as their function parameter.

Now to test your data structure, create a few StudentInfo object in the driver file (main.cpp), insert them in a list and finally print 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

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions