Please explain what this task is about?
“Create a generic linked list class that enables us to create a chain objects of different types.”
Do we need to create a class of type linkedlist and implement list interface?
class LinkedList<T>:IList<T>
{
//implement interface methods here?
}
Please give example.
For a linked list, I wouldn’t typically recommend implementing
IList, sinceIListstrongly implies constant-time access to any member of the list. I would recommend implementingICollection, then adding additional methods that are integral to linked lists, such asPushFront,PopBack, etc. You might look at the MSDN documentation for theLinkedList<T>class for comparison (http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx), though you should implement your class separately.