除了排序,我已经在通用链表中完成了所有内容。我不知道如何使用IComparable
,也不知道该如何处理它,因为它是通用的。我甚至不知道我将要比较或排序什么?
public class Node<T> : IComparable<T>
{
private Node<T> next;
private T item;
}
所以
public int CompareTo( T other )
{
// TODO: Find out how to do it properly
throw new NotImplementedException();
}
将其转换为数组并排序,然后再转换回去也违反了指令。