Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me implement this scheme in a C++ .hpp ad .cpp class file, would appreciate your help ad give feedback! LinkedList -head: NoderT? The

image text in transcribed

Please help me implement this scheme in a C++ .hpp ad .cpp class file, would appreciate your help ad give feedback!

LinkedList -head: NoderT? The head of the list. -tail: NodecT>* The tail of the list. -size: int The size of the list. +LinkedList() (no-arg constructor) Creates a default linked liat. +LinkedList(\&list: LinkedListeT>) (copy constructor) Copies the list to this list. + -LinkedListo) (destructor) Destructs a linked list. +addFirst(element: T): void Adds the element to the head of the list. +addLast(element: T): void Adds the element to the tail of the list. +getFirst 0 : T const R.eturns the first element in the list. +getLast(): T const R.eturns the last element in the list. +removeFirsto: T R Removes the furst element from the list. +removeLastO: T Removes the last element from the list. +add(element: T) : void Appends a new element at the end of this list. +add(index: int, element: T) : void (Adds a new element at the apecified index in this liat. +clear0: void R Removes all the elements from this list. +contains(element: T): bool const Returns true if this list contains the specified element. +get(index: int) : T const Returns the element from this list at the specified index. +indexOf(element: T ) : int const R.eturns the inder of the first matching element in this list. +isEmpty(): bool const R.eturns true if this list contains no elements. +lastIndexOf(element: T) : int const R.eturns the index of the last matching element in this liat. +remove(element: T): void Removes the apecified element from this list. +getSizeO: int const Returns the number of elements in this list. +removeAt(index: int) : T Removes the element at the specified index and retums the removed element. +set(index: int, element: T ) : T Sets the element at the specified index and returns the element being replaced. +begin 0 : IteratoreT> const Returns an iterator for the first element in the liat. +endo: Iterator const Returns an iterator that passes the last element in the list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions