Download the following “custom” implementation of lists:
https://princomp.github.io/code/projects/CList_Intro.zip
Implement as many as the following methods as you can:
ToArray(), that returns an array containing the values
held in the calling object,CopyTo(int startP, int endP), that returns a
CList object containing the elements between indices
startP (included) and endP (excluded) in the
calling object, and throw an error if the range is outside the calling
object’s limits,FromArray(T[] arrayP) that appends to the calling
object the value held in the arrayP parameter,IndexCListOf(T elemP) returns a CList
containing all the indices where the value elemP is stored in the
calling object,Remove(int startP, int endP) that removes all the cells
between indices startP (included) and endP
(excluded) in the calling object, and throw an error if the range is
outside the calling object’s limits,Reverse(int startP, int endP) that reverse the order of
all the cells between indices startP (included) and
endP (excluded) in the calling object, and throw an error
if the range is outside the calling object’s limits,Concat(CList<T> clistP) that append to the end of
the calling object the elements in the CList
clistP,Insert(T elemP, int indexP) that insert at
indexP the elemP if the calling object is of size at least
indexP, and throw an error otherwise.Note that the methods are not necessarily in increasing order of
difficulty, you may find for example Concat simpler to
implement than ToArray.
You may copy any of the methods studied in class in your project if
it helps you, but you may not use any other library /
API (other than System, already loaded). In particular,
do not load the System.Collections.Generic
or System.Linq.
Developing a meaningful Main method will considerably
help you, and is highly recommended.
This project is brief and open to interpretation on purpose: it is designed to be a challenging (but fun!) optional project that allow you to showcase your skills and creativity.