public class CmpNode<T>: Node<CmpNode<T>, T>
where T: IComparable
{
public CmpNode(T value) : base(value) { }
public CmpNode(T value, CmpNode<T> next) : base(value, next) { }
public CmpNode<T> getMaxNode(){
var max = this;
var point = this;
while (point!.hasNext()){
if (max.value.CompareTo(point.value) == -1){
max = point;
}
point = point.next;
}
if (max.value.CompareTo(point.value) == -1){
max = point;
}
return max;
}
}
public class CmpNode<T>: Node<CmpNode<T>, T>
where T: IComparable
{
public CmpNode(T value) : base(value) { }
public CmpNode(T value, CmpNode<T> next) : base(value, next) { }
public CmpNode<T> getMaxNode(){
var max = this;
var point = this;
while (point!.hasNext()){
if (max.value.CompareTo(point.value) == -1){
max = point;
}
point = point.next;
}
if (max.value.CompareTo(point.value) == -1){
max = point;
}
return max;
}
}