I have everything in a Generic Linked list done except for sorting.
And I don't know how to use IComparable
or how I would go about doing this because it's generic. I don't know what I would even be comparing or sorting?
public class Node<T> : IComparable<T>
{
private Node<T> next;
private T item;
}
So
public int CompareTo( T other )
{
// TODO: Find out how to do it properly
throw new NotImplementedException();
}
It is also against the instructions to convert it to an array and then sort it, then convert it back.