Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP with c++ code.. Having trouble with this method. bool List::remove(int index){ //remove the Planet object at index, decreasing the size of the Vector by

HELP with c++ code..

Having trouble with this method.

bool List::remove(int index){ //remove the Planet object at index, decreasing the size of the Vector by 1. //return true on successful deletion or false if the index is out of bounds

}

Here is the header file..

#ifndef LIST_H #define LIST_H #include "Planet.h" #include class Node { friend class List; //allow list class to access private fields //https://www.geeksforgeeks.org/friend-class-function-cpp/ private: Planet *planet; Node *next; Node *prev; public: Planet* getPlanet(){return this->planet;} Node(Planet * p); };

class List{ private: Node *head; Node *tail; public: List(); ~List(); void insert(int index, Planet * p); Planet * read(int index); bool remove(int index); unsigned size(); };

#endif

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions