Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a C++ program about link list, please help me complete the codes, thanks!(the .h file has been provided) /* * List.h * *

This is a C++ program about link list, please help me complete the codes, thanks!(the .h file has been provided)

/* * List.h * * Class Description: List data collection ADT. * Class Invariant: Data collection with the following characteristics: * - Each element is unique (no duplicates). * - (What other characteristic does our List have?) * * * */ #pragma once // You can add #include statements if you wish. #include  #include "Patient.h" using namespace std; class List { private: /* * You can add more attributes to this class, * but you cannot remove the attributes below * nor can you change them. */ static const int MAX_ELEMENTS = 5; // Small capacity so can test when data collection becomes full // ***As we are testing the code of our assignment, we can // change the value given to this constant.*** Patient elements[MAX_ELEMENTS]; // Data structure with capacity of MAX_ELEMENTS int elementCount; // Current element count in element array int capacity; // Actual maximum capacity of element array public: /* * You can add more methods to this interface, * but you cannot remove the methods below * nor can you change their prototype. * */ // Default constructor List(); // Description: Returns the total element count currently stored in List. int getElementCount() const; // Description: Insert an element. // Precondition: newElement must not already be in data collection. // Postcondition: newElement inserted and elementCount has been incremented. bool insert(const Patient& newElement); // Description: Remove an element. // Postcondition: toBeRemoved is removed and elementCount has been decremented. bool remove( const Patient& toBeRemoved ); // Description: Remove all elements. void removeAll(); // Description: Search for target element. // Returns a pointer to the element if found, // otherwise, returns NULL. Patient* search(const Patient& target); }; // end List.h

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago