CSC 240 Lab 3 1) Update the specifications of the DeleteItem function of the array version of the class UnsortedType as follows:

CSC 240

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Lab 3

1) Update the specifications of the DeleteItem function of the array version of the class UnsortedType as follows:

a) If the ItemType to be deleted is not found in the list, then the list remains unchanged.

b) All copies of the item to be deleted are removed from the list, if they exist.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

What is the time complexity of the DeleteItem function and why?

2) Create a function called ShiftRight that shifts the contents of the list one index to the right bringing the last item (index = length – 1) of the list to the front (index = 0) of the list.

What is the time complexity of the ShiftRight function and why?

Use the following driver to test your implementations:

#include

#include “unsorted.h”

using namespace std;

int main() {

UnsortedType classList;

classList.PutItem(ItemType(4));

classList.PutItem(ItemType(5));

classList.PutItem(ItemType(4));
classList.PutItem(ItemType(4));

classList.PutItem(ItemType(8));

cout << "(original) length: " << classList.GetLength() << endl;

classList.ResetList();

classList.Print();

classList.ShiftRight();

cout << "(shifted right) length: " << classList.GetLength() << endl;

classList.ResetList();
classList.Print();

classList.DeleteItem(ItemType(4));

cout << "(delete all 4s) length: " << classList.GetLength() << endl;

classList.ResetList();
classList.Print();
classList.ShiftRight();

cout << "(shift right) length: " << classList.GetLength() << endl;

classList.ResetList();
classList.Print();

return 0;

}

Also, use the following ItemType class, as provided in your source code:

class ItemType

{

public:

ItemType();

RelationType ComparedTo(ItemType) const;

void Print(std::ostream&) const;

void Initialize(int number);

private:

int value;

};

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.

Order your essay today and save 30% with the discount code ESSAYHELP