I've changed from using IComparable
to IComparable<Artist>
However I'm getting the error
'RecordCollection.Artist' does not implement interface member 'System.IComparable.CompareTo(object)'
class Artist : IComparable<Artist>
I've added a CompareTo method.
Not sure what this error means, any help describing why I'm getting this would be great.
class Artist : IComparable<Artist>
{
private String Name;
private int NoMem;
public Artist(string Name, int NoMem)
{
this.Name = Name;
this.NoMem = NoMem;
}
public int CompareTo(Artist other)
{
if (other == null) return 1;
else
return 0;
}
}
New Artist AVL tree
AVLTree<Artist> treeAVL = new AVLTree<Artist>();