Question: that returns a new List containing the same elements as L, in the same order, but with all occurances of the target x removed. For

that returns a new List containing the same elements as L, in the same order, but with all occurances of the target x removed. For instance, if L=[1,2,3,2,5,6,4,2,7,8,2,9] and x=2, then the returned List would be [1,3,5,6,4,7,8,9]. The returned List will have its cursor placed at its back. If L does not contain the element x, then the returned List will be a copy of L. This function has no preconditions. List ADT operations (pa5): Iist () ; Iist (const List\& L) ; - Iist(); int length() const; Listelement front() const; Listelement back () const; int position () const; ListElement peekNext () const; Listelement peekPrev() const; void clear (); void moveFront (); void moveBack (); ListElement moveNext () ; Iistelement movePrev (); void insertAfter (IstElement x ) ; void insertBefore (Listelement x ) ; void setAfter (Listelement x ) ; void setbefore (Listelement x ) ; void eraseAfter () ; void eraseBefore (); int findNext (Listelement x ) ; int findPrev (isistelement x ) ; void cleanup (); List concat (const List \& L) const; std: :string to string() const; bool equals (const List\& R) const; friend std: :ostream\& operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
